diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-26 10:31:51 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-28 11:36:10 +0000 |
commit | 23ec1e91f4e0c567f5953de149b2ab3496490e87 (patch) | |
tree | d92290b52cfab35e17e00f95aaea68cdabc68c45 | |
parent | ea0f281333231787b54b7dc33fe51728ac465fe3 (diff) |
Print uninstallation progress on archive level with normal verbosity
Don't print the name of every single removed file and directory unless
the verbosity level is set to detailed, as this really chokes the UI
thread.
QPlainTextEdit would have had better performance for a real-time output
log widget than QTextEdit, but we cannot use it as we require support
for displaying and automatically aligning text also for RTL languages.
Task-number: QTIFW-2615
Change-Id: Ie2938941b32bb387c0528b894cd058f395561814
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r-- | src/libs/installer/extractarchiveoperation.cpp | 3 | ||||
-rw-r--r-- | src/libs/installer/extractarchiveoperation_p.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp index 17d521b9f..5dbb49454 100644 --- a/src/libs/installer/extractarchiveoperation.cpp +++ b/src/libs/installer/extractarchiveoperation.cpp @@ -271,6 +271,9 @@ void ExtractArchiveOperation::startUndoProcess(const QStringList &files) connect(thread, &WorkerThread::progressChanged, this, &ExtractArchiveOperation::progressChanged); + const QFileInfo archive(arguments().at(0)); + emit outputTextChanged(tr("Removing files extracted from \"%1\"").arg(archive.fileName())); + QEventLoop loop; connect(thread, &QThread::finished, &loop, &QEventLoop::quit, Qt::QueuedConnection); thread->start(); diff --git a/src/libs/installer/extractarchiveoperation_p.h b/src/libs/installer/extractarchiveoperation_p.h index 04b152259..24614de39 100644 --- a/src/libs/installer/extractarchiveoperation_p.h +++ b/src/libs/installer/extractarchiveoperation_p.h @@ -37,6 +37,7 @@ #include "adminauthorization.h" #include "utils.h" #include "errors.h" +#include "loggingutils.h" #include <QRunnable> #include <QThread> @@ -70,7 +71,8 @@ public: removedCounter++; const QFileInfo fi(file); - emit currentFileChanged(QDir::toNativeSeparators(file)); + if (LoggingHandler::instance().verboseLevel() == LoggingHandler::Detailed) + emit currentFileChanged(QDir::toNativeSeparators(file)); emit progressChanged(double(removedCounter) / m_files.count()); if (fi.isFile() || fi.isSymLink()) { m_op->deleteFileNowOrLater(fi.absoluteFilePath()); |