summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-20 19:37:58 +0100
committerJonathan Bauer2011-03-20 19:37:58 +0100
commit3e76f5ca4439ae87f436080b840dba180fb842d3 (patch)
treef02a320058973ec60fa85a84491ce222c513aefd /src/main.cpp
parentdebug console dummy only shown if debug mode active (diff)
downloadfbgui-3e76f5ca4439ae87f436080b840dba180fb842d3.tar.gz
fbgui-3e76f5ca4439ae87f436080b840dba180fb842d3.tar.xz
fbgui-3e76f5ca4439ae87f436080b840dba180fb842d3.zip
debug console now powered by qxt, custom engines, updated debug msgs. Download manager now uses notify(message) to send error/status to the javascript interface, checks for download errors (still some missing)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp20
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();
}