Skip to content

Commit

Permalink
Validate in main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pljones committed Jul 27, 2023
1 parent 650483b commit f9ef825
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,13 @@ int main ( int argc, char** argv )
exit ( 1 );
}

if ( ServerOnlyOptions.contains ( "--serverinfo" ) && strServerInfo.split ( ";" ).count() < 3 )
{
qWarning() << qUtf8Printable (
QString ( "\"--serverinfo '%1'\": must contain [name];[city];[country] - value will be ignored" ).arg ( strServerInfo ) );
strServerInfo = "";
}

#ifndef HEADLESS
if ( bUseGUI )
{
Expand Down
7 changes: 0 additions & 7 deletions src/serverlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,6 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum,
.arg ( slServInfoSeparateParams[2] )
.arg ( QLocale::countryToString ( ThisServerListEntry.eCountry ) ) );
}
else
{
if ( !strServerInfo.isEmpty() )
{
qWarning() << "Ignoring invalid serverinfo, please verify the parameter syntax.";
}
}

// per definition, the very first entry is this server and this entry will
// never be deleted
Expand Down
26 changes: 13 additions & 13 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,20 +934,20 @@ void CServerSettings::ReadSettingsFromXML ( const QDomDocument& IniXMLDocument,
static_cast<int> ( AT_DEFAULT ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}
//### TODO: END ###//
{
directoryType = static_cast<EDirectoryType> ( iValue );
}
//### TODO: END ###//

else if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}
else if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}

//### TODO: BEGIN ###//
// compatibility to old version < 3.9.0
Expand Down

0 comments on commit f9ef825

Please sign in to comment.