From 19b0bb9c9ecaf5ba17fd08a6aad2e143a7965c3f Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 5 Dec 2018 10:25:00 +0200 Subject: Fix 'Bad allocation' error in Windows Due to bug in QTextDocument (QTBUG-65865), installer will crash if it will write a lot of logs to 'Details View' in 'PerformInstallationPage'. Fixed so that instead of writing all extracted filenames to log, write only the name of package which is extracted. This will reduce the huge amount of log written and thus prevents the 'Bad allocation' crash. Task-number: QTIFW-1242 Change-Id: I98ff0df25bcc10d0f7bb79d6c4010665b5e2ac51 Reviewed-by: Iikka Eklund --- src/libs/installer/extractarchiveoperation.cpp | 5 ++++- src/libs/installer/packagemanagercore_p.cpp | 9 +++++++-- src/sdk/translations/ifw_da.ts | 4 ++-- src/sdk/translations/ifw_de.ts | 4 ++-- src/sdk/translations/ifw_es.ts | 4 ++-- src/sdk/translations/ifw_fr.ts | 4 ++-- src/sdk/translations/ifw_it.ts | 4 ++-- src/sdk/translations/ifw_ja.ts | 4 ++-- src/sdk/translations/ifw_pl.ts | 4 ++-- src/sdk/translations/ifw_ru.ts | 4 ++-- src/sdk/translations/ifw_zh_CN.ts | 4 ++-- 11 files changed, 29 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp index 128327855..12608a0d1 100644 --- a/src/libs/installer/extractarchiveoperation.cpp +++ b/src/libs/installer/extractarchiveoperation.cpp @@ -30,6 +30,7 @@ #include #include +#include namespace QInstaller { @@ -69,6 +70,9 @@ bool ExtractArchiveOperation::performOperation() m_files.clear(); + QFileInfo fileInfo(archivePath); + emit outputTextChanged(tr("Extracting \"%1\"").arg(fileInfo.fileName())); + QEventLoop loop; connect(&receiver, &Receiver::finished, &loop, &QEventLoop::quit); if (QThreadPool::globalInstance()->tryStart(runnable)) { @@ -126,7 +130,6 @@ bool ExtractArchiveOperation::testOperation() void ExtractArchiveOperation::fileFinished(const QString &filename) { m_files.prepend(filename); - emit outputTextChanged(QDir::toNativeSeparators(filename)); } } // namespace QInstaller diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index c20be0b78..167e806f8 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1867,9 +1867,11 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr const int opCount = operations.count(); // show only components which do something, MinimumProgress is only for progress calculation safeness + bool showDetailsLog = false; if (opCount > 1 || (opCount == 1 && operations.at(0)->name() != QLatin1String("MinimumProgress"))) { - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstalling component %1") - .arg(component->displayName())); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstalling component %1...") + .arg(component->displayName())); + showDetailsLog = true; } foreach (Operation *operation, operations) { @@ -1953,6 +1955,9 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr component->setInstalled(); component->markAsPerformedInstallation(); + + if (showDetailsLog) + ProgressCoordinator::instance()->emitDetailTextChanged(tr("Done")); } // -- private diff --git a/src/sdk/translations/ifw_da.ts b/src/sdk/translations/ifw_da.ts index 42a742217..dbe7fd826 100644 --- a/src/sdk/translations/ifw_da.ts +++ b/src/sdk/translations/ifw_da.ts @@ -1703,9 +1703,9 @@ Opdatering afbrudt! -Installing component %1 +Installing component %1... -Installerer komponenten %1 +Installerer komponenten %1... Installer Error diff --git a/src/sdk/translations/ifw_de.ts b/src/sdk/translations/ifw_de.ts index 1b0fdf8d5..347b17cec 100644 --- a/src/sdk/translations/ifw_de.ts +++ b/src/sdk/translations/ifw_de.ts @@ -1739,9 +1739,9 @@ Aktualisierung abgebrochen! -Installing component %1 +Installing component %1... -Komponente %1 wird installiert +Komponente %1 wird installiert... Installer Error diff --git a/src/sdk/translations/ifw_es.ts b/src/sdk/translations/ifw_es.ts index 1ce64b86e..5ad785ade 100644 --- a/src/sdk/translations/ifw_es.ts +++ b/src/sdk/translations/ifw_es.ts @@ -1422,9 +1422,9 @@ Uninstallation aborted! -Installing component %1 +Installing component %1... -Instalando componente %1 +Instalando componente %1... Installer Error diff --git a/src/sdk/translations/ifw_fr.ts b/src/sdk/translations/ifw_fr.ts index 905f090cf..c79aa1308 100644 --- a/src/sdk/translations/ifw_fr.ts +++ b/src/sdk/translations/ifw_fr.ts @@ -1892,9 +1892,9 @@ Mise à jour annulée ! -Installing component %1 +Installing component %1... -Installation du composant %1 +Installation du composant %1... Installer Error diff --git a/src/sdk/translations/ifw_it.ts b/src/sdk/translations/ifw_it.ts index 514013f57..7deb5f548 100644 --- a/src/sdk/translations/ifw_it.ts +++ b/src/sdk/translations/ifw_it.ts @@ -1885,9 +1885,9 @@ Update aborted! -Installing component %1 +Installing component %1... -Installazione componenti %1 +Installazione componenti %1... Installer Error diff --git a/src/sdk/translations/ifw_ja.ts b/src/sdk/translations/ifw_ja.ts index 321e445c2..f8c04e97e 100644 --- a/src/sdk/translations/ifw_ja.ts +++ b/src/sdk/translations/ifw_ja.ts @@ -1902,9 +1902,9 @@ Update aborted! -Installing component %1 +Installing component %1... -コンポーネントのインストール中: %1 +コンポーネントのインストール中: %1... Installer Error diff --git a/src/sdk/translations/ifw_pl.ts b/src/sdk/translations/ifw_pl.ts index 98af6f62d..64cd6ac7f 100644 --- a/src/sdk/translations/ifw_pl.ts +++ b/src/sdk/translations/ifw_pl.ts @@ -1895,9 +1895,9 @@ Przerwano uaktualnianie. -Installing component %1 +Installing component %1... -Instalacja komponentu %1 +Instalacja komponentu %1... Installer Error diff --git a/src/sdk/translations/ifw_ru.ts b/src/sdk/translations/ifw_ru.ts index 2783f3eef..f22b82dca 100644 --- a/src/sdk/translations/ifw_ru.ts +++ b/src/sdk/translations/ifw_ru.ts @@ -1708,9 +1708,9 @@ Update aborted! -Installing component %1 +Installing component %1... -Установка компонента %1 +Установка компонента %1... Installer Error diff --git a/src/sdk/translations/ifw_zh_CN.ts b/src/sdk/translations/ifw_zh_CN.ts index a826448d9..c2b55f9ec 100644 --- a/src/sdk/translations/ifw_zh_CN.ts +++ b/src/sdk/translations/ifw_zh_CN.ts @@ -1834,9 +1834,9 @@ Update aborted! -Installing component %1 +Installing component %1... -正在安装组件 %1 +正在安装组件 %1... Installer Error -- cgit v1.2.3