fix for #17 Default central server flag seems not to work in server GUI

This commit is contained in:
Volker Fischer 2014-02-23 18:17:46 +00:00
parent 17b5bb6dd9
commit 4dca2d1c93
2 changed files with 13 additions and 8 deletions

View file

@ -34,7 +34,7 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
CProtocol* pNConLProt )
: iPortNumber ( iNPortNum ),
iNumPredefinedServers ( 0 ),
bUseDefaultCentralServerAddress ( false ),
bUseDefaultCentralServerAddress ( false ), // must be false for the "no GUI" case
bCentServPingServerInList ( bNCentServPingServerInList ),
pConnLessProtocol ( pNConLProt )
{
@ -178,8 +178,11 @@ void CServerListManager::SetCentralServerAddress ( const QString sNCentServAddr
if ( !strCentralServerAddress.isEmpty() )
{
bIsCentralServer =
( !strCentralServerAddress.toLower().compare ( "localhost" ) ||
!strCentralServerAddress.compare ( "127.0.0.1" ) );
(
( !strCentralServerAddress.toLower().compare ( "localhost" ) ||
!strCentralServerAddress.compare ( "127.0.0.1" ) ) &&
( !bUseDefaultCentralServerAddress )
);
bEnabled = true;
}

View file

@ -284,16 +284,18 @@ void CSettings::Load()
{
// server:
// central server address
pServer->SetServerListCentralServerAddress (
GetIniSetting ( IniXMLDocument, "server", "centralservaddr" ) );
// use default central server address flag
// use default central server address flag (note that it is important
// to set this setting prior to the "central server address")
if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
{
pServer->SetUseDefaultCentralServerAddress ( bValue );
}
// central server address (to be set after the "use default central
// server address)
pServer->SetServerListCentralServerAddress (
GetIniSetting ( IniXMLDocument, "server", "centralservaddr" ) );
// server list enabled flag
if ( GetFlagIniSet ( IniXMLDocument, "server", "servlistenabled", bValue ) )
{