Skip to content

Commit

Permalink
Check for existence of config fie provided with -c option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemba committed Nov 16, 2024
1 parent 005240b commit 2fbcd9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/skyscraper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,14 @@ QList<QString> Skyscraper::readFileListFrom(const QString &filename) {
}

void Skyscraper::loadConfig(const QCommandLineParser &parser) {
QSettings settings(parser.isSet("c") ? parser.value("c") : "config.ini",
QSettings::IniFormat);
QString iniFile = parser.isSet("c") ? parser.value("c") : "config.ini";
if (!QFileInfo(iniFile).exists()) {
printf(
"\nWARNING! Provided config file '\033[1;33m%s\033[0m' does not "
"exist.\nSkyscraper will use default configuration values...\n\n",
iniFile.toStdString().c_str());
}
QSettings settings(iniFile, QSettings::IniFormat);

RuntimeCfg *rtConf = new RuntimeCfg(&config, &parser);
// Start by setting frontend, since we need it to set default for game list
Expand Down

0 comments on commit 2fbcd9d

Please sign in to comment.