diff options
author | Jonathan Bauer | 2011-03-25 23:39:10 +0100 |
---|---|---|
committer | Jonathan Bauer | 2011-03-25 23:39:10 +0100 |
commit | 10e4a1c9f584fae21c3e1fc6f509381eefd85486 (patch) | |
tree | dc76b6b2644f5e012d6badc0603100caccdbbdb6 /src | |
parent | improvements (diff) | |
download | fbgui-10e4a1c9f584fae21c3e1fc6f509381eefd85486.tar.gz fbgui-10e4a1c9f584fae21c3e1fc6f509381eefd85486.tar.xz fbgui-10e4a1c9f584fae21c3e1fc6f509381eefd85486.zip |
.
Diffstat (limited to 'src')
-rw-r--r-- | src/fbgui.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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)){ |