Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
/* Implementation *************************************************************/
CClient::CClient ( const quint16 iPortNumber,
const quint16 iQosNumber,
const QString& strConnOnStartupAddress,
const bool bNoAutoJackConnect,
const QString& strNClientName,
const bool bNDisableIPv6,
Expand Down Expand Up @@ -212,13 +211,6 @@ CClient::CClient ( const quint16 iPortNumber,
// start the socket (it is important to start the socket after all
// initializations and connections)
Socket.Start();

// do an immediate start if a server address is given
if ( !strConnOnStartupAddress.isEmpty() )
{
SetServerAddr ( strConnOnStartupAddress );
Start();
}
}

// MIDI setup will be handled after settings are assigned
Expand Down
1 change: 0 additions & 1 deletion src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ class CClient : public QObject
public:
CClient ( const quint16 iPortNumber,
const quint16 iQosNumber,
const QString& strConnOnStartupAddress,
const bool bNoAutoJackConnect,
const QString& strNClientName,
const bool bNDisableIPv6,
Expand Down
9 changes: 7 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,7 @@ int main ( int argc, char** argv )
#ifndef SERVER_ONLY
if ( bIsClient )
{
CClient
Client ( iPortNumber, iQosNumber, strConnOnStartupAddress, bNoAutoJackConnect, strClientName, bDisableIPv6, bMuteMeInPersonalMix );
CClient Client ( iPortNumber, iQosNumber, bNoAutoJackConnect, strClientName, bDisableIPv6, bMuteMeInPersonalMix );

// Create Settings with the client pointer
CClientSettings Settings ( &Client, strIniFileName );
Expand Down Expand Up @@ -988,6 +987,12 @@ int main ( int argc, char** argv )
else
# endif
{
if ( !strConnOnStartupAddress.isEmpty() )

@softins softins Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@softins softins Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - cleaned up that code.
Also clarified the PR summary.

{
Client.SetServerAddr ( strConnOnStartupAddress );
Client.Start();
}

// only start application without using the GUI
qInfo() << qUtf8Printable ( GetVersionAndNameStr ( false ) );

Expand Down
Loading