for server name/city/country and licence, the command line overwrites the ini-file setting

This commit is contained in:
Volker Fischer 2020-07-10 20:33:05 +02:00
parent 10abcff239
commit 51d3c95de0

View File

@ -799,17 +799,23 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
strLanguage = GetIniSetting ( IniXMLDocument, "server", "language", strLanguage = GetIniSetting ( IniXMLDocument, "server", "language",
CLocale::FindSysLangTransFileName ( CLocale::GetAvailableTranslations() ).first ); CLocale::FindSysLangTransFileName ( CLocale::GetAvailableTranslations() ).first );
// name // name/city/country (command line overwrites setting file, note that
pServer->SetServerName ( GetIniSetting ( IniXMLDocument, "server", "name" ) ); // name/city/country are set by one single command line argument so we
// can treat them combined here and it is sufficient to just check the name)
// city if ( pServer->GetServerName().isEmpty() )
pServer->SetServerCity ( GetIniSetting ( IniXMLDocument, "server", "city" ) );
// country
if ( GetNumericIniSet ( IniXMLDocument, "server", "country",
0, static_cast<int> ( QLocale::LastCountry ), iValue ) )
{ {
pServer->SetServerCountry ( static_cast<QLocale::Country> ( iValue ) ); // name
pServer->SetServerName ( GetIniSetting ( IniXMLDocument, "server", "name" ) );
// city
pServer->SetServerCity ( GetIniSetting ( IniXMLDocument, "server", "city" ) );
// country
if ( GetNumericIniSet ( IniXMLDocument, "server", "country",
0, static_cast<int> ( QLocale::LastCountry ), iValue ) )
{
pServer->SetServerCountry ( static_cast<QLocale::Country> ( iValue ) );
}
} }
// start minimized on OS start // start minimized on OS start
@ -818,11 +824,14 @@ if ( GetFlagIniSet ( IniXMLDocument, "server", "defcentservaddr", bValue ) )
pServer->SetAutoRunMinimized ( bValue ); pServer->SetAutoRunMinimized ( bValue );
} }
// licence type // licence type (command line overwrites setting file)
if ( GetNumericIniSet ( IniXMLDocument, "server", "licencetype", if ( pServer->GetLicenceType() == LT_NO_LICENCE )
0, 1 /* LT_CREATIVECOMMONS */, iValue ) )
{ {
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) ); if ( GetNumericIniSet ( IniXMLDocument, "server", "licencetype",
0, 1 /* LT_CREATIVECOMMONS */, iValue ) )
{
pServer->SetLicenceType ( static_cast<ELicenceType> ( iValue ) );
}
} }
// welcome message (command line overwrites setting file) // welcome message (command line overwrites setting file)