From a7fb2734a2e1e29a63fa60beae00b3a2496c8e5b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sun, 24 Apr 2011 17:42:03 +0200 Subject: log file config fix --- src/fbgui.h | 2 +- src/main.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/fbgui.h b/src/fbgui.h index 98ab4c4..5c3247d 100644 --- a/src/fbgui.h +++ b/src/fbgui.h @@ -28,7 +28,7 @@ #define DEFAULT_URL "http://www.google.com" #define DEFAULT_DOWNLOAD_DIR "/tmp/fbgui" #define DEFAULT_CONFIG_PATH "/etc/fbgui.conf" -#define DEFAULT_LOG_FILE_PATH "/tmp/fbgui.log" +#define DEFAULT_LOG_FILE_PATH "/tmp/fbgui.log2" #define DEFAULT_UPDATE_INTERVAL 1; #define DEFAULT_QRC_HTML_DIR ":/html" #define DEFAULT_FILE_TRIGGER "/tmp/fbgui/trigger" diff --git a/src/main.cpp b/src/main.cpp index 24e0430..d51bc02 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -49,13 +49,13 @@ int main(int argc, char *argv[]) { // parse command line arguments using getopt QMap clOpts; int longIndex = 0; - static const char *optString = "c:u:d:s:t:D:h"; + static const char *optString = "c:u:d:s:t:D:hl:"; static const struct option longOpts[] = { { "config", required_argument, NULL, 'c' }, { "url", required_argument, NULL, 'u' }, { "download", required_argument, NULL, 'd' }, { "serial", required_argument, NULL, 's' }, { "trigger", required_argument, NULL, 't' }, { "debug", required_argument, NULL, 'D' }, { "help", no_argument, NULL, 'h' }, { - "logfile", required_argument, NULL, 'l' } }; + "log", required_argument, NULL, 'l' } }; int opt = getopt_long(argc, argv, optString, longOpts, &longIndex); while (opt != -1) { switch (opt) { @@ -144,6 +144,7 @@ int main(int argc, char *argv[]) { else downloadPath = DEFAULT_DOWNLOAD_DIR; + // set update interval for download progress functions of download manager. if (confFileSettings.contains("default/update_interval")) updateInterval = confFileSettings.value("default/update_interval").toInt(); @@ -173,8 +174,8 @@ int main(int argc, char *argv[]) { ipConfigFilePath = confFileSettings.value("default/ip_config").toString(); // save path to log file - if (clOpts.contains("logFile")) - logFilePath = clOpts.value("logFile"); + if (clOpts.contains("logFile")){ + logFilePath = clOpts.value("logFile");qxtLog->debug() << "LOG FILE: " << clOpts.value("logFile");} else if (confFileSettings.contains("default/log_file")) logFilePath = confFileSettings.value("default/log_file").toString(); else -- cgit v1.2.3-55-g7522