From 9bc86ea4a4179cf671a3aa23ed833f80bfa927dd Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Sun, 24 Apr 2011 16:37:14 +0200 Subject: dm thread ending properly now, few fixes --- src/fbgui.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/fbgui.cpp') diff --git a/src/fbgui.cpp b/src/fbgui.cpp index 63f6983..e3c2d3a 100644 --- a/src/fbgui.cpp +++ b/src/fbgui.cpp @@ -61,13 +61,12 @@ fbgui::fbgui() { SLOT(notify(const QString&))); QObject::connect(jsi, SIGNAL(requestFile(const QString&)), dm, SLOT(downloadFile(const QString&))); - QObject::connect( - dm, + QObject::connect(dm, SIGNAL(updateProgress(const int&, const double&, const QString&)), jsi, SLOT(updateProgressBar(const int&, const double&, const QString&))); - QObject::connect(dm, SIGNAL(downloadQueueEmpty()), jsi, SLOT( - callbackOnFinished())); + QObject::connect(dm, SIGNAL(downloadQueueEmpty()), jsi, + SLOT(callbackOnFinished())); QObject::connect(dm, SIGNAL(downloadQueueEmpty()), this, SLOT(loadSystem())); // move download manager to its own thread @@ -92,7 +91,7 @@ fbgui::fbgui() { showFullScreen(); } fbgui::~fbgui() { - dmThread.quit(); + //dmThread.quit(); } //------------------------------------------------------------------------------------------- // Layout / actions setup @@ -162,8 +161,8 @@ void fbgui::watchForTrigger() { // watch the path to trigger file qxtLog->debug() << "[watcher] Watching " << fileToTriggerURL; _watcher = new QFileSystemWatcher(QStringList(fileToTriggerURL), this); -QObject::connect(_watcher, SIGNAL(fileChanged(const QString&)), this, - SLOT(prepareURLLoad())); + QObject::connect(_watcher, SIGNAL(fileChanged(const QString&)), this, + SLOT(prepareURLLoad())); } //------------------------------------------------------------------------------------------- @@ -353,6 +352,7 @@ void fbgui::performReboot() { */ void fbgui::prepareKexec() { + qxtLog->debug() << "[gui] Preparing kexec ..."; // try to read KCL file that was downloaded. QFile file(downloadPath + "/kcl"); if (!file.open(QIODevice::ReadOnly)) { @@ -465,6 +465,10 @@ void fbgui::toggleDebugConsole() { // //------------------------------------------------------------------------------------------- void fbgui::loadSystem() { + // stop the thread for the download manager + qxtLog->debug() << "[gui] Stopping download manager's thread..."; + dmThread.quit(); + //show loading system page. _webView->load(QUrl("qrc:/html/loadsystem.html")); prepareKexec(); -- cgit v1.2.3-55-g7522