From 66244c1853caca19a24581bff37bd11dc47a0f53 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 25 Mar 2011 22:55:14 +0100 Subject: fixes --- src/main.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c4902c6..3e643a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -142,16 +142,27 @@ int main(int argc, char *argv[]) else if (confFileSettings.contains("default/serial_location")) serialLocation = confFileSettings.value("default/serial_location").toString(); else - serialLocation = QString("/serial"); - - // basic std out engine is ugly... not yet initialised so using qDebug - qDebug() << "************* CONFIG INFO *************"; - qDebug() << "configFilePath: " << configFilePath.toUtf8(); - qDebug() << "baseURL: " << baseURL.toString().toUtf8(); - qDebug() << "downloadDir : " << downloadPath.toUtf8(); - qDebug() << "trigger: " << fileToTriggerURL.toUtf8(); - qDebug() << "serialLocation: " << serialLocation.toUtf8(); - qDebug() << "*******************************************"; + 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"; + } + + // purge /tmp/fbgui + if (QDir(QApplication::applicationFilePath()).rmdir("/tmp/fbgui")) + out << "Cleaned /tmp/fbgui...\n"; + else + out << "Nope...\n"; + + out.flush(); // start fbgui fbgui gui; -- cgit v1.2.3-55-g7522