summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-07-06 13:01:38 +0200
committerkh1 <qt-info@nokia.com>2011-07-06 13:13:07 +0200
commitc82f0912f653d99527eeaf6f23e2f307160ca268 (patch)
tree2a0c2142208450467aa4bd799434e7ad7e53d06d /installerbuilder
parent1d49013dd1c3ccf28cf61c214e8d64232df1b87a (diff)
Fix problem with showing wrong progress. Fake! :)
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/libinstaller/packagemanagercore.cpp3
-rw-r--r--installerbuilder/libinstaller/packagemanagercore_p.cpp22
-rw-r--r--installerbuilder/libinstaller/performinstallationform.cpp2
3 files changed, 10 insertions, 17 deletions
diff --git a/installerbuilder/libinstaller/packagemanagercore.cpp b/installerbuilder/libinstaller/packagemanagercore.cpp
index 27701aa72..467e11e54 100644
--- a/installerbuilder/libinstaller/packagemanagercore.cpp
+++ b/installerbuilder/libinstaller/packagemanagercore.cpp
@@ -552,9 +552,6 @@ void PackageManagerCore::rollBackInstallation()
"error happend."));
}
}
-
- if (ProgressCoordinator::instance()->progressInPercentage() < 100)
- ProgressCoordinator::instance()->partProgressChanged(0.99);
packages.writeToDisk();
}
diff --git a/installerbuilder/libinstaller/packagemanagercore_p.cpp b/installerbuilder/libinstaller/packagemanagercore_p.cpp
index efe145d6c..2755bf2b6 100644
--- a/installerbuilder/libinstaller/packagemanagercore_p.cpp
+++ b/installerbuilder/libinstaller/packagemanagercore_p.cpp
@@ -1078,10 +1078,10 @@ void PackageManagerCorePrivate::runInstaller()
writeUninstaller(m_performedOperationsOld + m_performedOperationsCurrentSession);
registerUninstaller();
- // this is the reserved one from the beginning
- ProgressCoordinator::instance()->addManualPercentagePoints(1);
- if (ProgressCoordinator::instance()->progressInPercentage() < 100)
- ProgressCoordinator::instance()->partProgressChanged(0.99);
+ // fake a possible wrong value to show a full progress bar
+ const int progress = ProgressCoordinator::instance()->progressInPercentage();
+ if (progress < 100)
+ ProgressCoordinator::instance()->addManualPercentagePoints(100 - progress);
ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstallation finished!"));
if (adminRightsGained)
@@ -1220,10 +1220,10 @@ void PackageManagerCorePrivate::runPackageUpdater()
commitSessionOperations(); //end session, move ops to "old"
m_needToWriteUninstaller = true;
- //this is the reserved one from the beginning
- ProgressCoordinator::instance()->addManualPercentagePoints(1);
- if (ProgressCoordinator::instance()->progressInPercentage() < 100)
- ProgressCoordinator::instance()->partProgressChanged(0.99);
+ // fake a possible wrong value to show a full progress bar
+ const int progress = ProgressCoordinator::instance()->progressInPercentage();
+ if (progress < 100)
+ ProgressCoordinator::instance()->addManualPercentagePoints(100 - progress);
ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nUpdate finished!"));
if (adminRightsGained)
@@ -1330,7 +1330,7 @@ void PackageManagerCorePrivate::runUninstaller()
ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nDeinstallation aborted!"));
if (adminRightsGained)
m_core->dropAdminRights();
- emit installationFinished();
+ emit uninstallationFinished();
throw;
}
@@ -1391,10 +1391,6 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr
// fails or if this operation failed but still needs an undo call to cleanup.
addPerformed(operation);
operation->setValue(QLatin1String("component"), component->name());
- // Add the progress operation size to the progress coordinator, so we will show the right
- // progress at the end of the install/ update after we had an ignore error.
- if (ignoreError)
- ProgressCoordinator::instance()->partProgressChanged(progressOperationSize);
}
if (becameAdmin)
diff --git a/installerbuilder/libinstaller/performinstallationform.cpp b/installerbuilder/libinstaller/performinstallationform.cpp
index ce1bdc28b..c1ba65a93 100644
--- a/installerbuilder/libinstaller/performinstallationform.cpp
+++ b/installerbuilder/libinstaller/performinstallationform.cpp
@@ -122,7 +122,7 @@ void PerformInstallationForm::updateProgress()
QInstaller::ProgressCoordinator *progressCoordninator = QInstaller::ProgressCoordinator::instance();
const int progressPercentage = progressCoordninator->progressInPercentage();
- m_progressBar->setRange(0, (progressPercentage == 0) ? 0 : 100);
+ m_progressBar->setRange(0, 100);
m_progressBar->setValue(progressPercentage);
m_progressLabel->setText(progressCoordninator->labelText());
}