From 10e4a1c9f584fae21c3e1fc6f509381eefd85486 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 25 Mar 2011 23:39:10 +0100 Subject: . --- src/fbgui.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 158b360..b3b3ff4 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -111,6 +111,7 @@ void fbgui::watchForTrigger() if (file.remove()) qxtLog->debug() << "[watcher] Purged: " << file.fileName(); else{ + // this shouldn't happen ... qxtLog->debug() << "[watcher] Could not remove: " << file.fileName(); exit(EXIT_FAILURE); } @@ -159,28 +160,30 @@ void fbgui::loadURL() { // load if host is valid if (checkHost()){ + // disconnect _watcher, his job is done + qxtLog->debug() << "[watcher] disconnected."; + _watcher->disconnect(this); + _watcher->deleteLater(); // memory problems with watcher qxtLog->debug() << "[gui] Loading URL..."; QByteArray postData = generatePOSTData(); qxtLog->debug() << "[gui] POST data: " << postData; QNetworkRequest req(baseURL); _webView->load(req, QNetworkAccessManager::PostOperation, postData); } - // disconnect _watcher, his job is done - qxtLog->debug() << "[watcher] disconnected."; - _watcher->disconnect(this); } //------------------------------------------------------------------------------------------- QByteArray fbgui::generatePOSTData() { qxtLog->debug() << "[gui] Generating POST data..."; - // hash testing + // use MAC address as base data SysInfo si; QByteArray data(si.getInfo("mac").toUtf8()); qxtLog->debug() << "[post] Hashing: " << data; + // generate MD5 hash of data QByteArray hash = QCryptographicHash::hash(data, QCryptographicHash::Md5); qxtLog->debug() << "[post] MD5 Hash: " << hash.toHex(); - // fetch serial number from usb rootfs + // fetch serial number from usb QByteArray serial; QFile file(serialLocation); if (!file.open(QIODevice::ReadOnly)){ -- cgit v1.2.3-55-g7522