summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-08 12:28:29 +0100
committerJonathan Bauer2011-03-08 12:28:29 +0100
commitc0688eb6df802deb9cb56c2822391a67be5ab7cf (patch)
treecf1ed529ca165f9dfb9377ef30086dd6c05f9b78 /src/main.cpp
parent. (diff)
downloadfbgui-c0688eb6df802deb9cb56c2822391a67be5ab7cf.tar.gz
fbgui-c0688eb6df802deb9cb56c2822391a67be5ab7cf.tar.xz
fbgui-c0688eb6df802deb9cb56c2822391a67be5ab7cf.zip
first fixes
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 81e10dc..6f3d283 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
/* Parse cmdline argus. */
QMap<QString, QString> clo;
int longIndex = 0;
- static const char *optString = "u:hDd";
+ static const char *optString = "u:hDd:";
static const struct option longOpts[] =
{
{"url", required_argument, NULL, 'u'},
@@ -53,14 +53,15 @@ int main(int argc, char *argv[])
clo.insert("url", optarg);
break;
case 'd':
- clo.insert("downloadDir", optarg);
- break;
+ qDebug() << "Read from CLO: DD = " << optarg;
+ clo.insert("downloadDir", optarg);
+ break;
case 'D':
- clo.insert("debug", "debug");
- break;
+ clo.insert("debug", "debug");
+ break;
case 'h':
- clo.insert("help", "help");
- break;
+ clo.insert("help", "help");
+ break;
}
opt = getopt_long(argc, argv, optString, longOpts, &longIndex);
}
@@ -83,10 +84,14 @@ int main(int argc, char *argv[])
else
baseURL = DEFAULT_URL;
- if (clo.contains("downloadDir"))
+ if (clo.contains("downloadDir")){
downloadDirectory = QDir(clo.value("downloadDir"));
- else if (confFileSettings.contains("default/downloadDirectory"))
+ if (debug) qDebug() << "downloadDir set to: " << clo.value("downloadDir");
+ }
+ else if (confFileSettings.contains("default/downloadDirectory")){
downloadDirectory = QDir(confFileSettings.value("default/downloadDirectory").toString());
+ if (debug) qDebug() << "downloadDir set to: " << confFileSettings.value("default/downloadDirectory").toString();
+ }
else
downloadDirectory = QDir(".");
if (debug) qDebug() << "Downloads will be saved to: " << downloadDirectory.dirName();