summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/metadatajob.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2017-05-05 10:35:00 +0300
committerKatja Marttila <katja.marttila@qt.io>2017-05-10 07:09:28 +0000
commit41b18d6aa0277ae90bf6c76ee7bbc50696e7be26 (patch)
treec853aef989c1b551584ba2e54f16c562bd23c8c0 /src/libs/installer/metadatajob.cpp
parent3fdc5bd4b1a1f75496bd453b12dd01c662782958 (diff)
Add progressbar to indicate unzip job is proceeding
When a big compressed package is unzipped, it seemed that the installer hanged as there was no indication that the job is still ongoing. Added undetermined state to progress bar as unzip job does not inform the progress state. Task-number: QTIFW-967 Change-Id: I21ca394e1856038c51413f9e5011307ae7a9850a Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/libs/installer/metadatajob.cpp')
-rw-r--r--src/libs/installer/metadatajob.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index dbc7e8808..ecc66f493 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -141,10 +141,13 @@ void MetadataJob::doStart()
}
}
}
- if (!repositoriesFound)
+ if (!repositoriesFound) {
emitFinished();
- else
- emit infoMessage(this, tr("Unpacking compressed repositories..."));
+ }
+ else {
+ setProgressTotalAmount(0);
+ emit infoMessage(this, tr("Unpacking compressed repositories. This may take a while..."));
+ }
}
}
@@ -326,6 +329,7 @@ void MetadataJob::xmlTaskFinished()
DownloadFileTask *const metadataTask = new DownloadFileTask(m_packages);
metadataTask->setProxyFactory(m_core->proxyFactory());
m_metadataTask.setFuture(QtConcurrent::run(&DownloadFileTask::doTask, metadataTask));
+ setProgressTotalAmount(100);
emit infoMessage(this, tr("Retrieving meta information from remote repository..."));
} else if (status == XmlDownloadRetry) {
QMetaObject::invokeMethod(this, "doStart", Qt::QueuedConnection);
@@ -366,6 +370,11 @@ void MetadataJob::progressChanged(int progress)
setProcessedAmount(progress);
}
+void MetadataJob::setProgressTotalAmount(int maximum)
+{
+ setTotalAmount(maximum);
+}
+
void MetadataJob::metadataTaskFinished()
{
try {