summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJonathan Bauer2011-03-20 23:36:34 +0100
committerJonathan Bauer2011-03-20 23:36:34 +0100
commit7b39c4944dd9c6fa0778305e1cbd7286ce6571b5 (patch)
treef315d6c21f9deeb02fb9e89ed07022434f5ff40f /src/main.cpp
parentchecks for existance of download dir, and tries to set to /tmp/fbgui if all f... (diff)
downloadfbgui-7b39c4944dd9c6fa0778305e1cbd7286ce6571b5.tar.gz
fbgui-7b39c4944dd9c6fa0778305e1cbd7286ce6571b5.tar.xz
fbgui-7b39c4944dd9c6fa0778305e1cbd7286ce6571b5.zip
debug modes. -D now needs an arg: 0 for regular terminal output, 1 for debug console widget (to use on clients). new action ctrl + x kills app
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 ae59d79..f415206 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,13 +35,13 @@ int main(int argc, char *argv[])
/* parse command line arguments */
QMap<QString, QString> clOpts;
int longIndex = 0;
- static const char *optString = "u:d:c:Dh";
+ static const char *optString = "u:d:c:D:h";
static const struct option longOpts[] =
{
{"url", required_argument, NULL, 'u'},
{"download", required_argument, NULL, 'd'},
{"config", required_argument, NULL, 'c'},
- {"debug", no_argument, NULL, 'D'},
+ {"debug", required_argument, NULL, 'D'},
{"help", no_argument, NULL, 'h'}
};
int opt = getopt_long(argc, argv, optString, longOpts, &longIndex);
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
case 'c':
clOpts.insert("configFile", optarg);
case 'D':
- clOpts.insert("debug", "debug");
+ clOpts.insert("debug", optarg);
break;
case 'h':
clOpts.insert("help", "help");
@@ -70,12 +70,12 @@ int main(int argc, char *argv[])
if (clOpts.contains("help"))
printHelp();
- if (clOpts.contains("debug")){
- /* init qxt logger & set debug level */
- qxtLog->enableLogLevels(QxtLogger::DebugLevel);
- debug = true;
- }
- /* "search" config file */
+ if (clOpts.contains("debug"))
+ debugMode = clOpts.value("debug").toInt();
+ else
+ debugMode = -1;
+
+ /* look for config file */
QString configFilePath;
QFileInfo confInfo;
if (clOpts.contains("configFile"))