From ac32b9b876e5f44f4c1a31f18c11dc06004aeee9 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 13 Apr 2011 18:19:53 +0200 Subject: skip trigger checks if trigger is already present --- src/fbgui.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/fbgui.cpp') diff --git a/src/fbgui.cpp b/src/fbgui.cpp index c252bcb..f130347 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -140,15 +140,8 @@ void fbgui::watchForTrigger() // check if fileToTriggerURL already exists if (fi.exists()){ qxtLog->debug() << "[watcher] " << fileToTriggerURL << " exists already!"; - // try to remove it - QFile file(fi.absoluteFilePath()); - 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); - } + // load URL + if (checkHost()) loadURL(); } else { // watch the path where trigger file is expected @@ -219,13 +212,14 @@ bool fbgui::checkHost() const void fbgui::loadURL() { // disconnect _watcher, his job is done - qxtLog->debug() << "[watcher] disconnected."; - _watcher->disconnect(this); - _watcher->deleteLater(); // memory problems with watcher + //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); + // show arrow cursor qApp->setOverrideCursor(QCursor(Qt::ArrowCursor)); _webView->load(req, QNetworkAccessManager::PostOperation, postData); } @@ -234,7 +228,7 @@ void fbgui::loadURL() * This method generates the POST data body. * * This method generates the POST data body. The body contains the - * MAC address, an hardwarehas and a specific serial number. + * MAC address, an hardwarehash and a specific serial number. * The hardwarehash is a MD5 hash over the MAC address and the * mainboard serial number. * The specific serial number is set at the creation of the usb boot stick. -- cgit v1.2.3-55-g7522