summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-09-10 15:38:17 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-09-10 15:38:17 +0300
commit41865907dae243fc5508ec4df35a98317cfb817c (patch)
tree4b2bf862319573c9ac8a3fa1603e06f7cda3ae7b /src/libs/installer
parentbfa8427531cf871b7423c252f522b7bfe75c7edd (diff)
parent08e82c7f25401770fcd293d0bae1c08db30abf7d (diff)
Merge remote-tracking branch 'origin/4.1' into master
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/component.cpp34
-rw-r--r--src/libs/installer/componentselectionpage_p.cpp4
-rw-r--r--src/libs/installer/metadatajob.cpp2
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp9
-rw-r--r--src/libs/installer/packagemanagergui.cpp11
-rw-r--r--src/libs/installer/protocol.cpp8
-rw-r--r--src/libs/installer/proxycredentialsdialog.cpp4
-rw-r--r--src/libs/installer/qtpatch.cpp14
-rw-r--r--src/libs/installer/repository.cpp3
9 files changed, 53 insertions, 36 deletions
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index d50c36c61..6e3856502 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -45,6 +45,7 @@
#include <QtCore/QDirIterator>
#include <QtCore/QRegExp>
#include <QtCore/QTranslator>
+#include <QtCore/QRegularExpression>
#include <QApplication>
@@ -1309,6 +1310,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
@@ -1330,6 +1333,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
@@ -1639,26 +1644,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("<html><body>%1</body></html>").arg(d->m_vars.value(scDescription));
- if (isUnstable()) {
- tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
- "This component cannot be installed.");
- }
- setData(tooltipText, Qt::ToolTipRole);
+ tooltipText = QString::fromLatin1("<html><body>%1</body></html>").arg(d->m_vars.value(scDescription));
} else {
- QString tooltipText
- = d->m_vars.value(scDescription) + QLatin1String("<br><br>")
- + tr("Update Info: ") + updateInfo;
- if (isUnstable()) {
- tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
- "This component cannot be updated.");
- }
-
- setData(tooltipText, Qt::ToolTipRole);
+ tooltipText = d->m_vars.value(scDescription) + QLatin1String("<br><br>")
+ + tr("Update Info: ") + updateInfo;
}
+ if (isUnstable()) {
+ tooltipText += QLatin1String("<br>") + tr("There was an error loading the selected component. "
+ "This component cannot be installed.");
+ }
+ // replace {external-link}='' fields in component description with proper link tags
+ tooltipText.replace(QRegularExpression(QLatin1String("{external-link}='(.*?)'")),
+ QLatin1String("<a href=\"\\1\">\\1</a>"));
+
+ setData(tooltipText, Qt::ToolTipRole);
}
/*!
diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp
index b35c93bc4..a180888d1 100644
--- a/src/libs/installer/componentselectionpage_p.cpp
+++ b/src/libs/installer/componentselectionpage_p.cpp
@@ -354,10 +354,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("<a href=\"\\1\"><span style=\"color:#17a81a;\">\\1</span></a>"));
-
m_descriptionLabel->setText(description);
Component *component = m_currentModel->componentFromIndex(current);
diff --git a/src/libs/installer/metadatajob.cpp b/src/libs/installer/metadatajob.cpp
index 3408b3dab..68a242ebc 100644
--- a/src/libs/installer/metadatajob.cpp
+++ b/src/libs/installer/metadatajob.cpp
@@ -541,7 +541,9 @@ void MetadataJob::reset()
try {
m_xmlTask.cancel();
+ m_xmlTask.waitForFinished();
m_metadataTask.cancel();
+ m_metadataTask.waitForFinished();
} catch (...) {}
m_tempDirDeleter.releaseAndDeleteAll();
m_metadataResult.clear();
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index f323d676d..51c044356 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -923,8 +923,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<Repository> repos;
const QVariantList variants = cfg.value(QLatin1String("DefaultRepositories"))
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 7190795e0..67a2123af 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -2245,7 +2245,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<Component *> uncheckable = d->m_currentModel->uncheckable();
+ for (auto &component : uncheckable) {
+ if (component->forcedInstallation() && !component->isInstalled())
+ return true; // allow installation for new forced components
+ }
+ return false;
}
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.
*/
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<QString, QByteArray> 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()) {
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 <QDataStream>
#include <QFileInfo>
#include <QStringList>
+#include <QDir>
/*!
\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();