summaryrefslogtreecommitdiff
path: root/src/installationmanager.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2018-05-04 11:34:49 -0500
committerSilarn <jrim@rimpo.org>2018-05-04 11:34:49 -0500
commit0d7460996ae92c59f78cd2b5ccac43a1bf8869b2 (patch)
tree07165403c947a1e7e3b808728216994c4001474c /src/installationmanager.cpp
parentd9b1cfdb4b287fe43742269aaec26907ddcb6445 (diff)
Further offload setValue to avoid threading issues
Diffstat (limited to 'src/installationmanager.cpp')
-rw-r--r--src/installationmanager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp
index 4b433899..a99a07e1 100644
--- a/src/installationmanager.cpp
+++ b/src/installationmanager.cpp
@@ -444,7 +444,7 @@ void InstallationManager::updateProgressFile(QString const &fileName)
void InstallationManager::doProgressUpdate(float percentage)
{
if (m_InstallationProgress != nullptr) {
- m_InstallationProgress->setValue(static_cast<int>(percentage * 100.0));
+ QMetaObject::invokeMethod(this, "setProgressValue", Qt::QueuedConnection, Q_ARG(int, static_cast<int>(percentage * 100.0)));
if (m_InstallationProgress->wasCanceled()) {
m_ArchiveHandler->cancel();
@@ -453,6 +453,13 @@ void InstallationManager::doProgressUpdate(float percentage)
}
}
+void InstallationManager::setProgressValue(int percentage)
+{
+ if (m_InstallationProgress != nullptr) {
+ m_InstallationProgress->setValue(percentage);
+ }
+}
+
void InstallationManager::doProgressFileUpdate(QString const fileName)
{
if (m_InstallationProgress != nullptr) {