diff options
author | kh1 <karsten.heimrich@nokia.com> | 2011-09-27 15:14:54 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2011-09-27 16:11:52 +0200 |
commit | 085f78cb798d56602bee5c66121419d336294844 (patch) | |
tree | 0fb26df1417419fd430ccd2cfb33688f6782c7d8 /installerbuilder/libinstaller/packagemanagercore_p.cpp | |
parent | fd8711f9c463c7f4023c6d37592c409f2cf80460 (diff) |
Fixes QTIFW-41.
If we have written a new binary and running as updater, check
the state the core engine is in to decide if we should restart.
Since the ui "Finish" button sets the core status to Canceled,
avoid to restart. In case we have written a new maintenance
tool, the core engine knows the need to restart, take this into
account on the ui restart page and "finish" the dialog.
Change-Id: I40fbc2d352d16f606e7fdc4d5bc61ff9f48bd56c
Reviewed-on: http://codereview.qt-project.org/5626
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'installerbuilder/libinstaller/packagemanagercore_p.cpp')
-rw-r--r-- | installerbuilder/libinstaller/packagemanagercore_p.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp index 165ead73f..d7769485f 100644 --- a/installerbuilder/libinstaller/packagemanagercore_p.cpp +++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp @@ -1095,9 +1095,9 @@ void PackageManagerCorePrivate::writeUninstaller(OperationList performedOperatio deferredRename(dataFile + QLatin1String(".new"), dataFile, false); if (newBinaryWritten) { - verbose() << "Needs restart: " << (replacementExists && isUpdater()) << std::endl; - deferredRename(uninstallerName() + QLatin1String(".new"), uninstallerName(), - replacementExists && isUpdater()); + const bool restart = replacementExists && isUpdater() && (!statusCanceledOrFailed()); + deferredRename(uninstallerName() + QLatin1String(".new"), uninstallerName(), restart); + verbose() << "Maintenance tool restart: " << (restart ? "true." : "false.") << std::endl; } } catch (const Error &err) { setStatus(PackageManagerCore::Failure); |