diff options
author | Katja Marttila <katja.marttila@qt.io> | 2023-05-17 10:40:24 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2023-06-08 13:06:19 +0000 |
commit | 3a8815f6ac5514b6d0d991533733f533d014b064 (patch) | |
tree | 60aa8ea72bfffd1caa913c132090b679463d68ad /src | |
parent | 879d6c7bff4960f2ab164d0af8f681437d31c015 (diff) |
Fix tests built with Qt6
Due to api changes in Qt6 versus Qt5 we need minor changes to both
tests and to IFW itself.
Task-number: QTIFW-3064
Change-Id: I7e08161db074c96a6d639a2ff8b4c3d73f59e3cf
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/installer/extractarchiveoperation.cpp | 6 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 4 | ||||
-rw-r--r-- | src/libs/installer/remoteserverconnection.cpp | 3 |
3 files changed, 8 insertions, 5 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()); |