summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/extractarchiveoperation.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-10-08 16:09:01 +0200
committerTim Jenssen <tim.jenssen@digia.com>2013-10-09 12:08:09 +0200
commitc8de51cadbc5855ca1e77d038d7f09bf60d059ee (patch)
tree59f51e9e81122a5f033206cb0438669ef2ee5928 /src/libs/installer/extractarchiveoperation.cpp
parent1d090c2899925d03435dc8a160b431b2e57739b9 (diff)
Connect extract operation to progress calculation.
Ignore senders which are sending 100% more then once, got that from 7z lib at the extracting step. Task-number: QTIFW-11 Task-number: QTIFW-141 Change-Id: I7750f9e49d5705df91e6c79c7ee2b0530e156e84 Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/extractarchiveoperation.cpp')
-rw-r--r--src/libs/installer/extractarchiveoperation.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp
index 48c5db2c9..3897de4e4 100644
--- a/src/libs/installer/extractarchiveoperation.cpp
+++ b/src/libs/installer/extractarchiveoperation.cpp
@@ -75,13 +75,12 @@ bool ExtractArchiveOperation::performOperation()
Receiver receiver;
Callback callback;
- // usually we have to connect it as queued connection but then some blocking work is in the main thread
- connect(&callback, SIGNAL(progressChanged(QString)), this, SLOT(slotProgressChanged(QString)),
- Qt::DirectConnection);
+ connect(&callback, SIGNAL(currentFileChanged(QString)), this, SLOT(fileFinished(QString)));
+ connect(&callback, SIGNAL(progressChanged(double)), this, SIGNAL(progressChanged(double)));
if (PackageManagerCore *core = this->value(QLatin1String("installer")).value<PackageManagerCore*>()) {
connect(core, SIGNAL(statusChanged(QInstaller::PackageManagerCore::Status)), &callback,
- SLOT(statusChanged(QInstaller::PackageManagerCore::Status)), Qt::QueuedConnection);
+ SLOT(statusChanged(QInstaller::PackageManagerCore::Status)));
}
//Runnable is derived from QRunable which will be deleted by the ThreadPool -> no parent is needed
@@ -125,8 +124,8 @@ bool ExtractArchiveOperation::undoOperation()
const QStringList files = value(QLatin1String("files")).toStringList();
WorkerThread *const thread = new WorkerThread(this, files);
- connect(thread, SIGNAL(outputTextChanged(QString)), this, SIGNAL(outputTextChanged(QString)),
- Qt::QueuedConnection);
+ connect(thread, SIGNAL(currentFileChanged(QString)), this, SIGNAL(outputTextChanged(QString)));
+ connect(thread, SIGNAL(progressChanged(double)), this, SIGNAL(progressChanged(double)));
QEventLoop loop;
connect(thread, SIGNAL(finished()), &loop, SLOT(quit()), Qt::QueuedConnection);
@@ -149,7 +148,7 @@ Operation *ExtractArchiveOperation::clone() const
/*!
This slot is direct connected to the caller so please don't call it from another thread in the same time.
*/
-void ExtractArchiveOperation::slotProgressChanged(const QString &filename)
+void ExtractArchiveOperation::fileFinished(const QString &filename)
{
QStringList files = value(QLatin1String("files")).toStringList();
files.prepend(filename);