Load client settings before --connect startup#3738
Conversation
| SetServerAddr ( strConnOnStartupAddress ); | ||
| Start(); | ||
| } | ||
| Q_UNUSED ( strConnOnStartupAddress ); |
There was a problem hiding this comment.
To do this properly, if the CClient constructor is indeed the wrong place to start the connection, strConnOnStartupAddress should be removed from the signature and invocation of CClient::CClient(), rather than just declaring it as unused.
There was a problem hiding this comment.
Done in 8d62998: removed strConnOnStartupAddress from the CClient constructor signature and the main.cpp invocation, and dropped the temporary Q_UNUSED. Also verified with git diff --check and make -j2.
| else | ||
| # endif | ||
| { | ||
| if ( !strConnOnStartupAddress.isEmpty() ) |
There was a problem hiding this comment.
This looks like the wrong place to insert this code. Originally, the -c option worked in both GUI and headless modes. Putting it at this location makes it only work in headless mode.
I think the best place to move it to would be up a few lines to just before the #ifndef HEADLESS around line 968. That is after the settings have been loaded, but before the GUI is loaded (if any).
Otherwise if that doesn't fix your issue, move it down a few lines to around line 1001, just before the end of the if ( bIsClient ) block.
There was a problem hiding this comment.
Ah, looks like you're correct here. I've only just noticed that CClientDlg handles the connect-at-startup when in GUI mode.
So disregard the above comment. But The CClient constructor still needs the other change.
There was a problem hiding this comment.
Thanks - cleaned up that code.
Also clarified the PR summary.
4919b1a to
8d62998
Compare
8d62998 to
7e8750c
Compare
|
@seanogdelaney thank you! I've built it and it tests out fine. One remaining minor niggle is that the format check in the CI doesn't like the remaining blank line after If you have |
|
Ah, you got there first! |
softins
left a comment
There was a problem hiding this comment.
Many thanks, looks good to me now.
Thanks Tony for the help. Let me know what to do next, if anything. |
No problem. Nothing to do now, just wait for another team member to approve and merge. After that you can delete your branch. |
|
Has this been tested without the GUI as well, just to make sure nothing unexpected happens? Is JSONRPC control of the connected client still possible, etc? Looks like it should just work, though. |
Yes, I built it, and tested both with GUI and headless. It behaved as expected.
I didn't try the JSONRPC, which I always find rather fiddly. We could do with a JSONRPC controller application to make testing easier. Is there one? But I can't see anything in this change that would affect JSONRPC either way.
Agreed! |
Summary
This ensures startup connection negotiation uses the loaded client settings, including audio channel mode, so stereo-dependent UI/state such as pan controls is not initialized from constructor defaults.
CHANGELOG: Client: Ensure INI file settings are loaded before doing -c/--connect startup.
Testing
Fixes #3732