summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-16 01:43:47 +0100
committerJonathan Bauer2011-03-16 01:43:47 +0100
commit96b2528849d676ff0094dc06182031ac4506b937 (patch)
tree2f7af1c476e2f9d7c51644ce7ed535e4870c7c94 /src/main.cpp
parent-test code (diff)
downloadfbgui-96b2528849d676ff0094dc06182031ac4506b937.tar.gz
fbgui-96b2528849d676ff0094dc06182031ac4506b937.tar.xz
fbgui-96b2528849d676ff0094dc06182031ac4506b937.zip
misc
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8f2b6a5..3138838 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -8,7 +8,6 @@
void printHelp()
{
- // Prints usage information.
QTextStream qout(stdout);
qout << QObject::tr("Usage: ./fbgui [OPTIONS]") << endl;
qout << QObject::tr("Options:") << endl;
@@ -28,12 +27,11 @@ int main(int argc, char *argv[])
app.setObjectName("test");
binPath = QApplication::applicationDirPath();
- // Translator, for later (maybe).
QTranslator translator;
translator.load(":" + QLocale::system().name());
app.installTranslator(&translator);
- /* Parse cmdline argus. */
+ /* parse command line arguments */
QMap<QString, QString> clOpts;
int longIndex = 0;
static const char *optString = "u:d:c:Dh";
@@ -67,14 +65,15 @@ int main(int argc, char *argv[])
}
opt = getopt_long(argc, argv, optString, longOpts, &longIndex);
}
- // Print help
+
if (clOpts.contains("help"))
- printHelp();
- // Debug mode
+ printHelp();
+
if (clOpts.contains("debug")){
debug = true;
qDebug() << "Debug mode activated.";
}
+ /* "search" config file */
QString configFilePath;
QFileInfo confInfo;
if (clOpts.contains("configFile"))
@@ -94,7 +93,7 @@ int main(int argc, char *argv[])
}
if (debug) qDebug() << "Config file is: " << configFilePath;
- // Read the config file, for now hardcoded expected name.
+ /* read the config file */
QSettings confFileSettings(configFilePath, QSettings::IniFormat);
confFileSettings.setIniCodec("UTF-8");
@@ -112,7 +111,7 @@ int main(int argc, char *argv[])
}
if (debug) qDebug() << "Base URL: " << baseURL.toString();
- // Setting target downloads directory.
+ /* setting directory for downloads*/
if (clOpts.contains("downloadDir")){
downloadPath = clOpts.value("downloadDir");
if (debug) qDebug() << "Download directory loaded from cmdline.";
@@ -123,7 +122,7 @@ int main(int argc, char *argv[])
}
else
{
- downloadPath = DEFAULT_DOWNLOAD_DIR; // Default download dir.
+ downloadPath = DEFAULT_DOWNLOAD_DIR;
if (debug) qDebug() << "Download directory set by default.";
}
if (debug) qDebug() << "Download directory: " << downloadPath;
@@ -132,6 +131,7 @@ int main(int argc, char *argv[])
updateInterval = confFileSettings.value("default/updateInterval").toInt();
if (debug) qDebug() << "Read updateInterval from confFile: " << updateInterval;
}
+ else updateInterval = DEFAULT_UPDATE_INTERVAL;
fbgui gui;
return app.exec();