From f34ed0b633f30a6871a0d82409b1490565d1c96d Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Fri, 18 Jun 2021 11:41:54 +0300 Subject: Fix usage of '--install-compressed-repository' with a relative file path Use a function overload of QUrl::fromUserInput that takes a workingDirectory parameter, in order to be able to handle relative paths. Otherwise a string pointing to a relative local file path is handled as a short form of a HTTP URL. Change-Id: I5811661680728e79555ea7b99d0a1e8a8f294b44 Reviewed-by: Katja Marttila --- src/libs/installer/repository.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/repository.cpp b/src/libs/installer/repository.cpp index e959d8550..50f3eceb6 100644 --- a/src/libs/installer/repository.cpp +++ b/src/libs/installer/repository.cpp @@ -32,6 +32,7 @@ #include #include #include +#include /*! \fn inline uint QInstaller::qHash(const Repository &repository) @@ -89,7 +90,7 @@ Repository::Repository(const QUrl &url, bool isDefault, bool compressed) */ Repository Repository::fromUserInput(const QString &repositoryUrl, bool compressed) { - QUrl url = QUrl::fromUserInput(repositoryUrl); + QUrl url = QUrl::fromUserInput(repositoryUrl, QDir::currentPath()); const QStringList supportedSchemes = KDUpdater::FileDownloaderFactory::supportedSchemes(); if (!supportedSchemes.contains(url.scheme()) && QFileInfo(url.toString()).exists()) url = QLatin1String("file:///") + url.toString(); -- cgit v1.2.3 From a8b4b4da9db8c4bee2494157cecb2a474d92d2e3 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Fri, 4 Jun 2021 12:59:21 +0300 Subject: Fix replacing of {external-link} tags in component tree view tooltips Task-number: QTIFW-2264 Change-Id: Ie7191ba75d923cc8d8eb353f7fac85818b87591f Reviewed-by: Katja Marttila Reviewed-by: Qt CI Bot --- src/libs/installer/component.cpp | 30 ++++++++++++------------- src/libs/installer/componentselectionpage_p.cpp | 4 ---- 2 files changed, 14 insertions(+), 20 deletions(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index cb9959ba3..5f897303d 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -1628,26 +1629,23 @@ void Component::updateModelData(const QString &key, const QString &data) setData(humanReadableSize(size), UncompressedSize); } + QString tooltipText; const QString &updateInfo = d->m_vars.value(scUpdateText); if (!d->m_core->isUpdater() || updateInfo.isEmpty()) { - QString tooltipText - = QString::fromLatin1("%1").arg(d->m_vars.value(scDescription)); - if (isUnstable()) { - tooltipText += QLatin1String("
") + tr("There was an error loading the selected component. " - "This component can not be installed."); - } - setData(tooltipText, Qt::ToolTipRole); + tooltipText = QString::fromLatin1("%1").arg(d->m_vars.value(scDescription)); } else { - QString tooltipText - = d->m_vars.value(scDescription) + QLatin1String("

") - + tr("Update Info: ") + updateInfo; - if (isUnstable()) { - tooltipText += QLatin1String("
") + tr("There was an error loading the selected component. " - "This component can not be updated."); - } - - setData(tooltipText, Qt::ToolTipRole); + tooltipText = d->m_vars.value(scDescription) + QLatin1String("

") + + tr("Update Info: ") + updateInfo; } + if (isUnstable()) { + tooltipText += QLatin1String("
") + tr("There was an error loading the selected component. " + "This component can not be installed."); + } + // replace {external-link}='' fields in component description with proper link tags + tooltipText.replace(QRegularExpression(QLatin1String("{external-link}='(.*?)'")), + QLatin1String("\\1")); + + setData(tooltipText, Qt::ToolTipRole); } /*! diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index a9f4ba134..37dc0f13e 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -331,10 +331,6 @@ void ComponentSelectionPagePrivate::currentSelectedChanged(const QModelIndex &cu QString description = m_currentModel->data(m_currentModel->index(current.row(), ComponentModelHelper::NameColumn, current.parent()), Qt::ToolTipRole).toString(); - // replace {external-link}='' fields in component description with proper link tags - description.replace(QRegularExpression(QLatin1String("{external-link}='(.*?)'")), - QLatin1String("\\1")); - m_descriptionLabel->setText(description); Component *component = m_currentModel->componentFromIndex(current); -- cgit v1.2.3 From 2b53c4767b7f6378fa1bb855339f207f6a13c39e Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 10 Aug 2021 16:33:56 +0300 Subject: Doc: Minor function summary fix for component JS object The "component::addDependency" and "component::addAutoDependOn" methods support also specifying a comma separated list of components in the same string parameter. Change-Id: I7f4d289d80d4efd485a0cfa64c6dda93bfc2f59a Reviewed-by: Leena Miettinen Reviewed-by: Katja Marttila --- src/libs/installer/component.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libs/installer') diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp index 5f897303d..3b8894b03 100644 --- a/src/libs/installer/component.cpp +++ b/src/libs/installer/component.cpp @@ -1299,6 +1299,8 @@ bool Component::validatePage() /*! Adds the component specified by \a newDependency to the list of dependencies. + Alternatively, multiple components can be specified by separating each with + a comma. \sa {component::addDependency}{component.addDependency} \sa dependencies @@ -1320,6 +1322,8 @@ QStringList Component::dependencies() const /*! Adds the component specified by \a newDependOn to the automatic depend-on list. + Alternatively, multiple components can be specified by separating each with + a comma. \sa {component::addAutoDependOn}{component.addAutoDependOn} \sa autoDependencies -- cgit v1.2.3 From f4d1e57345c6c0a052828c1801281012a58a1cef Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Thu, 12 Aug 2021 15:25:25 +0300 Subject: Fix hang when canceling metadatajob by an external call Installer may leave an event loop running in DownloadFileTask::doTask when shutting down, if Downloader::testCanceled() was not yet triggered by connection events, or by a timer timeout used to check if the user has canceled download while the connection is blocked. Fix by waiting for the tasks to finish when canceled. Task-number: QTIFW-2282 Change-Id: I8800cdb3c368da3edaf8def50e3b8e837d3e993c Reviewed-by: Katja Marttila --- src/libs/installer/metadatajob.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libs/installer') diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp index 2a9cb5ae7..7a6866dc2 100644 --- a/src/libs/installer/metadatajob.cpp +++ b/src/libs/installer/metadatajob.cpp @@ -545,7 +545,9 @@ void MetadataJob::reset() try { m_xmlTask.cancel(); + m_xmlTask.waitForFinished(); m_metadataTask.cancel(); + m_metadataTask.waitForFinished(); } catch (...) {} m_tempDirDeleter.releaseAndDeleteAll(); m_metadataResult.clear(); -- cgit v1.2.3 From 2389c5138d99a6ac0caea0f13d2d40f8b5cbc7d3 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Thu, 5 Aug 2021 17:00:30 +0300 Subject: QtPatch: Fix catching non-zero exit codes from "qmake -query" Also make the detailed output to be shown on the installation error message box. Task-number: QTIFW-2273 Change-Id: I9c678a0b382d52a6ff9ba78e0d93118714cc96ae Reviewed-by: Katja Marttila --- src/libs/installer/qtpatch.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/qtpatch.cpp b/src/libs/installer/qtpatch.cpp index 89b5dddf6..f72e67867 100644 --- a/src/libs/installer/qtpatch.cpp +++ b/src/libs/installer/qtpatch.cpp @@ -82,14 +82,16 @@ QHash QtPatch::qmakeValues(const QString &qmakePath, QByteA process.start(qmake.absoluteFilePath(), args, QIODevice::ReadOnly); if (process.waitForFinished(10000)) { QByteArray output = process.readAllStandardOutput(); - qmakeOutput->append(output); - if (process.exitStatus() == QProcess::CrashExit) { - qCWarning(QInstaller::lcInstallerInstallLog) << qmake.absoluteFilePath() << args - << "crashed with exit code" << process.exitCode() - << "standard output:" << output - << "error output:" << process.readAllStandardError(); + if ((process.exitStatus() == QProcess::CrashExit) || (process.exitCode() != EXIT_SUCCESS)) { + QStringList detailedOutput = { qmake.absoluteFilePath() + QLatin1Char(' ') + args.join(QLatin1Char(' ')) + + QString::fromLatin1(" returned with exit code: \"%1\".").arg(QString::number(process.exitCode())) + , QString::fromLatin1("Standard output: \"%1\".").arg(QLatin1String(output)) + , QString::fromLatin1("Error output: \"%1\".").arg(QLatin1String(process.readAllStandardError())) + }; + qmakeOutput->append(detailedOutput.join(QLatin1Char('\n'))); return qmakeValueHash; } + qmakeOutput->append(output); qmakeValueHash = readQmakeOutput(output); } if (qmakeValueHash.isEmpty()) { -- cgit v1.2.3 From 72c6dc7bd1cb53c99ac1ca79e1a242ae6ba7d619 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 3 Aug 2021 15:41:53 +0300 Subject: MT: Fix reading of StartMenuDir value from incorrect config file Value of StartMenuDir variable should be permanent after initial installation and must be read from maintenancetool.ini, don't use the default value from internal configuration file (metadata/installer- config/config.xml) of the maintenance tool binary as it: - Does not contain the path prefix for either user or system-wide start menu directory, we add this later depending on the installation type. - May change altogether with a new configuration file if the vendor has provided an update mechanism for maintenance tool, or if the user has opted for a non-default location. Task-number: QTIFW-2284 Change-Id: Id731d151b9f0acc77aa146722d1e088ea6a47eb3 Reviewed-by: Qt CI Bot Reviewed-by: Katja Marttila --- src/libs/installer/packagemanagercore_p.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 24a67d095..270cd7760 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -920,8 +920,13 @@ void PackageManagerCorePrivate::readMaintenanceConfigFiles(const QString &target const QVariantHash v = cfg.value(QLatin1String("Variables")).toHash(); // Do not change to // QVariantMap! Breaks reading from existing .ini files, cause the variant types do not match. for (QVariantHash::const_iterator it = v.constBegin(); it != v.constEnd(); ++it) { - if (!m_data.contains(it.key()) || m_data.value(it.key()).isNull()) - m_data.setValue(it.key(), replacePath(it.value().toString(), QLatin1String(scRelocatable), targetDir)); + if (m_data.contains(it.key()) && !m_data.value(it.key()).isNull()) { + // Exception: StartMenuDir should be permanent after initial installation + // and must be read from maintenancetool.ini + if (it.key() != scStartMenuDir) + continue; + } + m_data.setValue(it.key(), replacePath(it.value().toString(), QLatin1String(scRelocatable), targetDir)); } QSet repos; const QVariantList variants = cfg.value(QLatin1String("DefaultRepositories")) -- cgit v1.2.3 From 284fb7d87bc1f017c3f04e703749b367b24e505f Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 10 Aug 2021 15:55:07 +0300 Subject: MT: Install new components with default check state ComponentSelectionPage::isComplete() would return false if the state of the component model was "DefaultChecked" and user had not (de)selected any new components. This change adds a condition to check if there are any ForcedInstallation components that haven't been previously installed, and allows navigating forward and installing those without additional selections. Task-number: QTIFW-2286 Change-Id: I273cc7219df1eae4e11ff23e733d71a9c297bedd Reviewed-by: Katja Marttila --- src/libs/installer/packagemanagergui.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 86c3a2d0c..52b0bb222 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -2241,7 +2241,16 @@ bool ComponentSelectionPage::isComplete() const { if (packageManagerCore()->isInstaller() || packageManagerCore()->isUpdater()) return d->m_currentModel->checked().count(); - return d->m_currentModel->checkedState().testFlag(ComponentModel::DefaultChecked) == false; + + if (d->m_currentModel->checkedState().testFlag(ComponentModel::DefaultChecked) == false) + return true; + + const QSet uncheckable = d->m_currentModel->uncheckable(); + for (auto &component : uncheckable) { + if (component->forcedInstallation() && !component->isInstalled()) + return true; // allow installation for new forced components + } + return false; } -- cgit v1.2.3 From 08e82c7f25401770fcd293d0bae1c08db30abf7d Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Mon, 2 Aug 2021 17:46:55 +0300 Subject: Fix misc QDoc warnings Task-number: QTIFW-2253 Change-Id: Idf0216c1b4491160ee06924241bf26aaace9c883 Reviewed-by: Leena Miettinen --- src/libs/installer/protocol.cpp | 8 ++++---- src/libs/installer/proxycredentialsdialog.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libs/installer') diff --git a/src/libs/installer/protocol.cpp b/src/libs/installer/protocol.cpp index 3bafc481e..fb16086e5 100644 --- a/src/libs/installer/protocol.cpp +++ b/src/libs/installer/protocol.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -35,19 +35,19 @@ typedef qint32 PackageSize; /*! \inmodule QtInstallerFramework - \namespace Protocol + \namespace QInstaller::Protocol \brief Contains values related to the internal client-server connection protocol. */ /*! - \enum Protocol::Mode + \enum QInstaller::Protocol::Mode \value Debug \value Production */ /*! - \enum Protocol::StartAs + \enum QInstaller::Protocol::StartAs \value User \value SuperUser diff --git a/src/libs/installer/proxycredentialsdialog.cpp b/src/libs/installer/proxycredentialsdialog.cpp index f536a05cd..2ac07b855 100644 --- a/src/libs/installer/proxycredentialsdialog.cpp +++ b/src/libs/installer/proxycredentialsdialog.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -34,7 +34,7 @@ namespace QInstaller { /*! \inmodule QtInstallerFramework - \namespace Ui + \namespace QInstaller::Ui \brief Groups user interface forms generated with Qt Designer. */ -- cgit v1.2.3