diff options
author | Jonathan Bauer | 2011-03-25 23:27:48 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-03-25 23:27:48 +0100 |
commit | ac5d4a4dfdd417d6344e8ede262204a78f73e433 (patch) | |
tree | 0b77fa806947474409fa940d08f1fc8ee5bc962d /src | |
parent | fixes (diff) | |
download | fbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.tar.gz fbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.tar.xz fbgui-ac5d4a4dfdd417d6344e8ede262204a78f73e433.zip |
improvements
Diffstat (limited to 'src')
-rw-r--r-- | src/downloadmanager.cpp | 1 | ||||
-rw-r--r-- | src/fbgui.cpp | 19 | ||||
-rw-r--r-- | src/fbgui.h | 7 | ||||
-rw-r--r-- | src/javascriptinterface.cpp | 1 | ||||
-rw-r--r-- | src/main.cpp | 30 |
5 files changed, 24 insertions, 34 deletions
diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 3582a2a..0f79eef 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -165,7 +165,6 @@ void DownloadManager::downloadProgress(qint64 bytesIn, qint64 bytesTotal) qxtLog->debug() << "[dm] Download progress of " << currentDownload->url().toString() << ": " << bytesIn << "/" << bytesTotal << "(" << currentProgress << "\%)"; } - return; } // ------------------------------------------------------------------------------------------------------- void DownloadManager::downloadFinished() diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 1f706c7..158b360 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -9,7 +9,6 @@ #include <QtWebKit> #include <QxtCore> - QString binPath(""); QUrl baseURL(""); QString downloadPath(""); @@ -27,7 +26,6 @@ fbgui::fbgui() //sil->getInfoAboutNetworkInterface(); //sil->getInfoAboutClassNet(); - setupBasicDebug(); setupLayout(); createActions(); @@ -168,7 +166,7 @@ void fbgui::loadURL() _webView->load(req, QNetworkAccessManager::PostOperation, postData); } // disconnect _watcher, his job is done - qxtLog->debug() << "[watcher] see you soon!"; + qxtLog->debug() << "[watcher] disconnected."; _watcher->disconnect(this); } //------------------------------------------------------------------------------------------- @@ -203,20 +201,7 @@ QByteArray fbgui::generatePOSTData() return postData; } //------------------------------------------------------------------------------------------- -// Debug setup / control -//------------------------------------------------------------------------------------------- -void fbgui::setupBasicDebug() -{ - // start basic console debug log - if (debugMode > -1){ - qxtLog->disableLoggerEngine("DEFAULT"); - qxtLog->addLoggerEngine("std_logger", new LoggerEngine_std); - qxtLog->initLoggerEngine("std_logger"); - qxtLog->setMinimumLevel("std_logger", QxtLogger::DebugLevel); - qxtLog->enableLogLevels(QxtLogger::DebugLevel); - qxtLog->debug() << "Initializing fbgui..."; - } -} +// Debug console setup / control //------------------------------------------------------------------------------------------- void fbgui::createDebugConsole() { diff --git a/src/fbgui.h b/src/fbgui.h index 5a1f39d..d385426 100644 --- a/src/fbgui.h +++ b/src/fbgui.h @@ -51,14 +51,13 @@ public: fbgui(); private: - // debug setup - void setupBasicDebug(); - void createDebugConsole(); // layout setup void setupLayout(); void createActions(); + // debug console setup + void createDebugConsole(); - // functions to trigger the loading of baseURL + // functions to control the loading of baseURL void watchForTrigger(); bool checkHost() const; void loadURL(); diff --git a/src/javascriptinterface.cpp b/src/javascriptinterface.cpp index d0fa5a9..e7da701 100644 --- a/src/javascriptinterface.cpp +++ b/src/javascriptinterface.cpp @@ -18,6 +18,7 @@ const QString JavascriptInterface::getSysInfo(const QString& info){ //------------------------------------------------------------------------------------------------------- void JavascriptInterface::attachToDOM(){ _parent->addToJavaScriptWindowObject(QString("fbgui"), this); + qxtLog->debug() << "[jvi] Attached to DOM."; loadJQuery(); } //------------------------------------------------------------------------------------------------------- diff --git a/src/main.cpp b/src/main.cpp index 178d3e3..b9643c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,7 @@ #include <getopt.h> #include <cstdlib> #include <iostream> +#include "loggerengine.h" #include "fbgui.h" void printHelp() @@ -80,8 +81,16 @@ int main(int argc, char *argv[]) if (clOpts.contains("help")) printHelp(); - if (clOpts.contains("debug")) + if (clOpts.contains("debug")){ debugMode = clOpts.value("debug").toInt(); + // start basic debug log + qxtLog->disableLoggerEngine("DEFAULT"); + qxtLog->addLoggerEngine("std_logger", new LoggerEngine_std); + qxtLog->initLoggerEngine("std_logger"); + qxtLog->setMinimumLevel("std_logger", QxtLogger::DebugLevel); + qxtLog->enableLogLevels(QxtLogger::DebugLevel); + qxtLog->debug() << "Initializing fbgui..."; + } else debugMode = -1; @@ -144,17 +153,14 @@ int main(int argc, char *argv[]) else serialLocation = QString("/serial"); // tests - // debug config printing - QTextStream out(stdout); - if (debugMode > -1){ - out << "************* CONFIG INFO *************\n"; - out << "configFilePath: " << configFilePath.toUtf8() << endl; - out << "baseURL: " << baseURL.toString().toUtf8() << endl; - out << "downloadDir : " << downloadPath.toUtf8() << endl; - out << "trigger: " << fileToTriggerURL.toUtf8() << endl; - out << "serialLocation: " << serialLocation.toUtf8() << endl; - out << "*******************************************\n"; - } + // print config + qxtLog->debug() << "************* CONFIG INFO *************"; + qxtLog->debug() << "configFilePath: " << configFilePath.toUtf8(); + qxtLog->debug() << "baseURL: " << baseURL.toString().toUtf8(); + qxtLog->debug() << "downloadDir : " << downloadPath.toUtf8(); + qxtLog->debug() << "trigger: " << fileToTriggerURL.toUtf8(); + qxtLog->debug() << "serialLocation: " << serialLocation.toUtf8(); + qxtLog->debug() << "*******************************************"; // start fbgui fbgui gui; |