diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-13 09:32:06 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-06-13 12:45:59 +0200 |
commit | 76e094b51bc74184fe9d8fd6fc20f91199e8bd92 (patch) | |
tree | b8e6a56dab233c9752e1e88e5a2b6ea58523c187 /src/libs/installer/performinstallationform.cpp | |
parent | 2c8099f23396e995cd8a3c7f66ebacef32aa75e2 (diff) |
save some cpu cycles in updateProgress() method
Change-Id: Ie1d297ef7cea97ce0e179d85385711031aeea38d
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'src/libs/installer/performinstallationform.cpp')
-rw-r--r-- | src/libs/installer/performinstallationform.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/installer/performinstallationform.cpp b/src/libs/installer/performinstallationform.cpp index 37cf993fe..953c918a2 100644 --- a/src/libs/installer/performinstallationform.cpp +++ b/src/libs/installer/performinstallationform.cpp @@ -107,6 +107,8 @@ void PerformInstallationForm::setupUi(QWidget *widget) m_updateTimer = new QTimer(widget); connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateProgress())); //updateProgress includes label m_updateTimer->setInterval(30); + + m_progressBar->setRange(0, 100); } void PerformInstallationForm::setDetailsWidgetVisible(bool visible) @@ -124,8 +126,12 @@ void PerformInstallationForm::updateProgress() QInstaller::ProgressCoordinator *progressCoordninator = QInstaller::ProgressCoordinator::instance(); const int progressPercentage = progressCoordninator->progressInPercentage(); - m_progressBar->setRange(0, 100); m_progressBar->setValue(progressPercentage); + + static QString lastLabelText; + if (lastLabelText == progressCoordninator->labelText()) + return; + lastLabelText = progressCoordninator->labelText(); m_progressLabel->setText(m_progressLabel->fontMetrics().elidedText(progressCoordninator->labelText(), Qt::ElideRight, m_progressLabel->width())); } |