diff options
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/main.cpp b/src/main.cpp index 689b3e4..ae59d79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,8 +71,9 @@ int main(int argc, char *argv[]) printHelp(); if (clOpts.contains("debug")){ + /* init qxt logger & set debug level */ + qxtLog->enableLogLevels(QxtLogger::DebugLevel); debug = true; - qDebug() << "Debug mode activated."; } /* "search" config file */ QString configFilePath; @@ -88,11 +89,9 @@ int main(int argc, char *argv[]) if (confInfo.exists()) configFilePath = QString("/etc/fbgui.conf"); else - /* temporary */ - configFilePath = QApplication::applicationDirPath() + "/fbgui.conf"; + configFilePath = DEFAULT_CONFIG_PATH; } } - if (debug) qDebug() << "Config file is: " << configFilePath; /* read the config file */ QSettings confFileSettings(configFilePath, QSettings::IniFormat); @@ -100,40 +99,31 @@ int main(int argc, char *argv[]) if (clOpts.contains("url")) { baseURL = QUrl(clOpts.value("url")); - if (debug) qDebug() << "URL loaded from cmdline."; } else if (confFileSettings.contains("default/url")) { baseURL = confFileSettings.value("default/url").toUrl(); - if (debug) qDebug() << "URL loaded from config file."; } else { baseURL = DEFAULT_URL; - if (debug) qDebug() << "URL set by default."; } - if (debug) qDebug() << "Base URL: " << baseURL.toString(); /* setting directory for downloads*/ if (clOpts.contains("downloadDir")){ downloadPath = clOpts.value("downloadDir"); - if (debug) qDebug() << "Download directory loaded from cmdline."; } else if (confFileSettings.contains("default/downloadDirectory")){ downloadPath = confFileSettings.value("default/downloadDirectory").toString(); - if (debug) qDebug() << "Download directory loaded from config file."; } - else - { + else { downloadPath = DEFAULT_DOWNLOAD_DIR; - if (debug) qDebug() << "Download directory set by default."; } - if (debug) qDebug() << "Download directory: " << downloadPath; if (confFileSettings.contains("default/updateInterval")){ updateInterval = confFileSettings.value("default/updateInterval").toInt(); - if (debug) qDebug() << "Read updateInterval from confFile: " << updateInterval; } else updateInterval = DEFAULT_UPDATE_INTERVAL; fbgui gui; + gui.show(); return app.exec(); } |
