summaryrefslogtreecommitdiffstats
path: root/installerbuilder/installerbase/tabcontroller.cpp
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-04-14 12:18:58 +0200
committerkh1 <qt-info@nokia.com>2011-04-14 12:18:58 +0200
commit4a6600711b51d60936c0bdf34f092d52345f6a3a (patch)
tree75949264f1450e3da70b3348f42ade35d8390930 /installerbuilder/installerbase/tabcontroller.cpp
parent0812827af0e8d22815e066622e42c69c474a252f (diff)
Emit the restart as late as possible.
This gives us the time to update the ui and show the start page. Fixes the "freeze" hang after we have finished e.g. the package manager and reevaluation of the repository.
Diffstat (limited to 'installerbuilder/installerbase/tabcontroller.cpp')
-rw-r--r--installerbuilder/installerbase/tabcontroller.cpp61
1 files changed, 32 insertions, 29 deletions
diff --git a/installerbuilder/installerbase/tabcontroller.cpp b/installerbuilder/installerbase/tabcontroller.cpp
index 34f52d6d9..1b145dfdb 100644
--- a/installerbuilder/installerbase/tabcontroller.cpp
+++ b/installerbuilder/installerbase/tabcontroller.cpp
@@ -41,6 +41,7 @@
#include <KDUpdater/PackagesInfo>
#include <QtCore/QPointer>
+#include <QtCore/QTimer>
#include <QtScript/QScriptEngine>
@@ -94,6 +95,34 @@ TabController::~TabController()
delete d;
}
+void TabController::setInstallerGui(QInstaller::Gui *gui)
+{
+ d->m_gui = gui;
+ connect(d->m_gui, SIGNAL(gotRestarted()), this, SLOT(restartWizard()));
+}
+
+void TabController::setControlScript (const QString &script)
+{
+ d->m_controlScript = script;
+}
+
+void TabController::setApplication(KDUpdater::Application *app)
+{
+ d->m_app = app;
+}
+
+void TabController::setInstaller(QInstaller::Installer *installer)
+{
+ d->m_installer = installer;
+}
+
+void TabController::setInstallerParams(const QHash<QString, QString> &params)
+{
+ d->m_params = params;
+}
+
+// -- public slots
+
int TabController::init()
{
if (!d->m_init) {
@@ -139,34 +168,6 @@ int TabController::init()
return initPackageManager();
}
-void TabController::setInstallerGui(QInstaller::Gui *gui)
-{
- d->m_gui = gui;
- connect(d->m_gui, SIGNAL(gotRestarted()), this, SLOT(restartWizard()));
-}
-
-void TabController::setControlScript (const QString &script)
-{
- d->m_controlScript = script;
-}
-
-void TabController::setApplication(KDUpdater::Application *app)
-{
- d->m_app = app;
-}
-
-void TabController::setInstaller(QInstaller::Installer *installer)
-{
- d->m_installer = installer;
-}
-
-void TabController::setInstallerParams(const QHash<QString, QString> &params)
-{
- d->m_params = params;
-}
-
-// -- public slots
-
int TabController::initUpdater()
{
if (d->m_updaterInitialized) {
@@ -278,7 +279,9 @@ void TabController::rejected()
void TabController::restartWizard()
{
d->m_installer->reset(d->m_params);
- init(); // restart and switch back to intro page
+
+ // restart and switch back to intro page
+ QTimer::singleShot(0, this, SLOT(init()));
}
void TabController::updaterFinishedWithError()