diff options
7 files changed, 19 insertions, 11 deletions
diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp index 8995bbcbf..b00a67190 100644 --- a/src/libs/installer/extractarchiveoperation.cpp +++ b/src/libs/installer/extractarchiveoperation.cpp @@ -215,7 +215,8 @@ bool ExtractArchiveOperation::performOperation() } files[i] = replacePath(files.at(i), installDir, QLatin1String(scRelocatable)); } - out << files; + if (!files.isEmpty()) + out << files; setValue(QLatin1String("files"), file.fileName()); file.close(); } else { @@ -253,7 +254,8 @@ bool ExtractArchiveOperation::undoOperation() if (!readDataFileContents(targetDir, &files)) return false; } - startUndoProcess(files); + if (!files.isEmpty()) + startUndoProcess(files); if (!useStringListType) deleteDataFile(m_relocatedDataFileName); diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 31fa3d744..35fd28337 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2560,7 +2560,7 @@ bool PackageManagerCore::componentUninstallableFromCommandLine(const QString &co } ComponentModel *model = defaultComponentModel(); const QModelIndex &idx = model->indexFromComponentName(component->treeName()); - if (model->data(idx, Qt::CheckStateRole) == QVariant::Invalid) { + if (model->data(idx, Qt::CheckStateRole) == QVariant()) { // Component cannot be unselected, check why if (component->forcedInstallation()) { qCWarning(QInstaller::lcInstallerInstallLog).noquote().nospace() @@ -2602,7 +2602,7 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo } const QModelIndex &idx = model->indexFromComponentName(component->treeName()); if (idx.isValid()) { - if ((model->data(idx, Qt::CheckStateRole) == QVariant::Invalid) && !component->forcedInstallation()) { + if ((model->data(idx, Qt::CheckStateRole) == QVariant()) && !component->forcedInstallation()) { // User cannot select the component, check why if (component->autoDependencies().count() > 0) { errorMessage.append(tr("Cannot install component %1. Component is installed only as automatic " diff --git a/src/libs/installer/remoteserverconnection.cpp b/src/libs/installer/remoteserverconnection.cpp index bf4e8040c..9a80637f9 100644 --- a/src/libs/installer/remoteserverconnection.cpp +++ b/src/libs/installer/remoteserverconnection.cpp @@ -429,7 +429,8 @@ void RemoteServerConnection::handleQSettings(RemoteServerReply *reply, const QSt QString key; QVariant defaultValue; data >> key; - data >> defaultValue; + if (!data.atEnd()) + data >> defaultValue; reply->send(settings->value(key, defaultValue)); } else if (command == QLatin1String(Protocol::QSettingsOrganizationName)) { reply->send(settings->organizationName()); diff --git a/tests/auto/installer/clientserver/tst_clientserver.cpp b/tests/auto/installer/clientserver/tst_clientserver.cpp index 5aa40a5a3..fd6a08d87 100644 --- a/tests/auto/installer/clientserver/tst_clientserver.cpp +++ b/tests/auto/installer/clientserver/tst_clientserver.cpp @@ -369,7 +369,6 @@ private slots: QCOMPARE(settings.contains("key"), false); const QDateTime dateTime = QDateTime::currentDateTimeUtc(); - QCOMPARE(settings.iniCodec(), nullptr); // The wrapper does not support this method, but assume: // QCOMPARE(wrapper.iniCodec(), QTextCodec::codecForName("UTF-8")); wrapper.setValue("dateTime", dateTime); diff --git a/tests/auto/installer/commandlineinstall/tst_commandlineinstall.cpp b/tests/auto/installer/commandlineinstall/tst_commandlineinstall.cpp index 021c487cc..48b7bf35d 100644 --- a/tests/auto/installer/commandlineinstall/tst_commandlineinstall.cpp +++ b/tests/auto/installer/commandlineinstall/tst_commandlineinstall.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2022 The Qt Company Ltd. +** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -771,7 +771,9 @@ private: (core->*func)(std::forward<Args>(args)...); std::cout.rdbuf(buf); - QVERIFY(stream && stream.str() == message.toStdString()); + QVERIFY(stream && stream.tellp() == message.size()); + for (const QString &line : message.split(QLatin1String("\n"))) + QVERIFY(stream.str().find(line.toStdString()) != std::string::npos); } private: diff --git a/tests/auto/installer/componentmodel/tst_componentmodel.cpp b/tests/auto/installer/componentmodel/tst_componentmodel.cpp index 6bf78d88d..276292233 100644 --- a/tests/auto/installer/componentmodel/tst_componentmodel.cpp +++ b/tests/auto/installer/componentmodel/tst_componentmodel.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -373,7 +373,11 @@ private slots: { QStringList localesToTest = { "en_US", "ru_RU", "de_DE", "fr_FR" }; foreach (const QString &localeToTest, localesToTest) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + QLocale::setDefault(QLocale(localeToTest)); +#else QLocale::setDefault(localeToTest); +#endif QString expectedName = rootComponentDisplayNames.contains(localeToTest.toLower()) ? rootComponentDisplayNames[localeToTest.toLower()] : rootComponentDisplayNames[QString()]; diff --git a/tests/auto/installer/repository/tst_repository.cpp b/tests/auto/installer/repository/tst_repository.cpp index db538ba5d..410c369ed 100644 --- a/tests/auto/installer/repository/tst_repository.cpp +++ b/tests/auto/installer/repository/tst_repository.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2023 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -168,7 +168,7 @@ private slots: categories.insert(category); settings.setRepositoryCategories(categories); - QHash<QString, QPair<Repository, Repository>> update; + QMultiHash<QString, QPair<Repository, Repository>> update; // non-empty update update.insert(QLatin1String("replace"), qMakePair(original, replacement)); |