From 17b5bb6dd9b35077c5ec9c6c6be434c357627cad Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 23 Feb 2014 09:46:25 +0000 Subject: [PATCH] introduce macro ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING for enabling the version and OS query in the client (for debugging reasons) --- src/client.cpp | 2 ++ src/client.h | 2 ++ src/clientdlg.cpp | 2 ++ src/clientdlg.h | 2 ++ src/connectdlg.cpp | 18 +++++++----------- src/connectdlg.h | 2 ++ src/global.h | 5 +++++ 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index c4d99f08..81db37c7 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -199,9 +199,11 @@ QObject::connect ( &Channel, SIGNAL ( OpusSupported() ), SIGNAL ( CLPingWithNumClientsReceived ( CHostAddress, int, int ) ), this, SLOT ( OnCLPingWithNumClientsReceived ( CHostAddress, int, int ) ) ); +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING QObject::connect ( &ConnLessProtocol, SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ), SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ) ); +#endif // other QObject::connect ( &Sound, SIGNAL ( ReinitRequest ( int ) ), diff --git a/src/client.h b/src/client.h index 0a9c952e..3c556b41 100755 --- a/src/client.h +++ b/src/client.h @@ -416,9 +416,11 @@ signals: int iPingTime, int iNumClients ); +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING void CLVersionAndOSReceived ( CHostAddress InetAddr, COSUtil::EOpSystemType eOSType, QString strVersion ); +#endif void Disconnected(); diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index b6b7beab..04eab665 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -495,9 +495,11 @@ CClientDlg::CClientDlg ( CClient* pNCliP, SIGNAL ( CLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ), this, SLOT ( OnCLPingTimeWithNumClientsReceived ( CHostAddress, int, int ) ) ); +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING QObject::connect ( pClient, SIGNAL ( CLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ), this, SLOT ( OnCLVersionAndOSReceived ( CHostAddress, COSUtil::EOpSystemType, QString ) ) ); +#endif QObject::connect ( pClient, SIGNAL ( UpstreamRateChanged() ), diff --git a/src/clientdlg.h b/src/clientdlg.h index 3096712f..ee84dd9b 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -129,10 +129,12 @@ public slots: int iPingTime, int iNumClients ); +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING void OnCLVersionAndOSReceived ( CHostAddress InetAddr, COSUtil::EOpSystemType eOSType, QString strVersion ) { ConnectDlg.SetVersionAndOSType ( InetAddr, eOSType, strVersion ); } +#endif void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); } void OnOpenGeneralSettings() { ShowGeneralSettings(); } diff --git a/src/connectdlg.cpp b/src/connectdlg.cpp index 56177ec5..0f1b690f 100755 --- a/src/connectdlg.cpp +++ b/src/connectdlg.cpp @@ -384,18 +384,12 @@ void CConnectDlg::OnTimerPing() data ( 0, Qt::UserRole ).toString(), CurServerAddress ) ) { - // if address is valid, send ping - -// TEST send request for version and OS instead of ping message -const bool bEnableVerOSDebugging = false; // if this is set the "false", we have to regular version -if ( bEnableVerOSDebugging ) -{ - emit CreateCLServerListReqVerAndOSMes ( CurServerAddress ); -} -else -{ + // if address is valid, send ping or the version and OS request +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING + emit CreateCLServerListReqVerAndOSMes ( CurServerAddress ); +#else emit CreateCLServerListPingMes ( CurServerAddress ); -} +#endif } } } @@ -479,6 +473,7 @@ void CConnectDlg::SetPingTimeAndNumClientsResult ( CHostAddress& } } +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING void CConnectDlg::SetVersionAndOSType ( CHostAddress InetAddr, COSUtil::EOpSystemType eOSType, QString strVersion ) @@ -508,3 +503,4 @@ if ( lvwServers->topLevelItem ( iIdx )->isHidden() ) } } } +#endif diff --git a/src/connectdlg.h b/src/connectdlg.h index e1cdca74..c1441e03 100755 --- a/src/connectdlg.h +++ b/src/connectdlg.h @@ -62,9 +62,11 @@ public: const CMultiColorLED::ELightColor ePingTimeLEDColor, const int iNumClients ); +#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING void SetVersionAndOSType ( CHostAddress InetAddr, COSUtil::EOpSystemType eOSType, QString strVersion ); +#endif bool GetServerListItemWasChosen() const { return bServerListItemWasChosen; } QString GetSelectedAddress() const { return strSelectedAddress; } diff --git a/src/global.h b/src/global.h index 121bc152..fb9ff6f9 100755 --- a/src/global.h +++ b/src/global.h @@ -69,6 +69,11 @@ LED bar: lbr //#define _DEBUG_ #undef _DEBUG_ +// define this macro if the version and operating system debugging shall +// be enabled in the client (the ping time column in the connect dialog then +// shows the requested information instead of the ping time) +#undef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING + // version and application name (use version from qt prject file) #undef VERSION #define VERSION APP_VERSION