From bb779c6c002acc56af95ca0e7de6aaecc3fcd559 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 24 Mar 2011 11:53:32 +0100 Subject: misc --- src/downloadmanager.cpp | 12 ++++++------ src/fbgui.cpp | 3 +-- src/main.cpp | 12 ++++++------ 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 501b1d5..bcfaafb 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -144,17 +144,17 @@ void DownloadManager::downloadProgress(qint64 bytesIn, qint64 bytesTotal) // calculate current speed double speed = bytesIn * 1000 / dltime.elapsed(); QString unit; - if (speed < 1024) { + if (speed < 1024){ unit = "bytes/sec"; - } - else if (speed < 1024*1024) { + } + else if (speed < 1024*1024){ speed /= 1024; unit = "KB/s"; - } - else { + } + else{ speed /= 1024*1024; unit = "MB/s"; - } + } // update progress only if difference higher than the updateInterval setting currentProgress = ((bytesIn * 100) / bytesTotal); if (currentProgress - lastProgress >= updateInterval){ diff --git a/src/fbgui.cpp b/src/fbgui.cpp index c0a8839..7c590c5 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -154,9 +154,8 @@ void fbgui::loadURL(){ QNetworkRequest req(baseURL); QByteArray postData("mac=d8:d3:85:80:81:8b&hardwarehash=12341234123412341234123412341234&bootisoID=1&serial="); - // serial number - QByteArray serial; // fetch serial number from usb rootfs + QByteArray serial; QFile file(serialLocation); if (!file.exists()){ qxtLog->debug() << "No such file: " << file.fileName(); diff --git a/src/main.cpp b/src/main.cpp index 1fa82ee..514d124 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) case 'h': clOpts.insert("help", "help"); break; - } + } opt = getopt_long(argc, argv, optString, longOpts, &longIndex); } @@ -148,11 +148,11 @@ int main(int argc, char *argv[]) // basic std out engine is ugly... not yet initialised so using qDebug qDebug() << "************* CONFIG INFO *************"; - qDebug() << "configFilePath: " << configFilePath; - qDebug() << "baseURL: " << baseURL; - qDebug() << "downloadDir : " << downloadPath; - qDebug() << "trigger: " << fileToTriggerURL; - qDebug() << "serialLocation: " << serialLocation; + qDebug() << "configFilePath: " << configFilePath.toUtf8(); + qDebug() << "baseURL: " << baseURL.toString().toUtf8(); + qDebug() << "downloadDir : " << downloadPath.toUtf8(); + qDebug() << "trigger: " << fileToTriggerURL.toUtf8(); + qDebug() << "serialLocation: " << serialLocation.toUtf8(); qDebug() << "*******************************************"; // start fbgui -- cgit v1.2.3-55-g7522