Commit d6447d49 authored by Volker Krause's avatar Volker Krause
Browse files

Remaining changes to build with Qt6

Minor build system fixes, container sizes, QVariant comparison, missing
includes, QStringRef.
parent 19b0408d
Pipeline #168296 passed with stage
in 1 minute and 3 seconds
......@@ -107,5 +107,5 @@ if(EXISTS "/etc/debian_version")
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.discover.apt.urlhandler.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
endif()
install(FILES plasmadiscoverui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/plasmadiscover)
install(FILES plasmadiscoverui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/plasmadiscover)
install(FILES org.kde.discover.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
......@@ -19,6 +19,7 @@
#include <QDBusMessage>
#include <QDBusPendingCall>
#include <QDesktopServices>
#include <QFile>
#include <QGuiApplication>
#include <QPointer>
#include <QQmlApplicationEngine>
......
......@@ -64,7 +64,7 @@ void ReadFile::processPath(QString &path)
auto matchIt = envRx.globalMatch(path);
while (matchIt.hasNext()) {
auto match = matchIt.next();
path.replace(match.capturedStart(), match.capturedLength(), QString::fromUtf8(qgetenv(match.capturedRef(1).toUtf8().constData())));
path.replace(match.capturedStart(), match.capturedLength(), QString::fromUtf8(qgetenv(match.capturedView(1).toUtf8().constData())));
}
}
......@@ -76,7 +76,7 @@ void ReadFile::process()
auto it = m_filter.globalMatch(read);
while (it.hasNext()) {
const auto match = it.next();
m_contents.append(match.capturedRef(match.lastCapturedIndex()));
m_contents.append(match.capturedView(match.lastCapturedIndex()));
m_contents.append(QLatin1Char('\n'));
}
} else
......
......@@ -22,7 +22,11 @@
#include <QWindow>
#include <QProcessEnvironment>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <private/qtx11extras_p.h>
#endif
typedef QHash<QString, DiscoverObject::CompactMode> StringCompactMode;
Q_GLOBAL_STATIC_WITH_ARGS(StringCompactMode,
......
......@@ -67,7 +67,9 @@ public:
}
};
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_DECLARE_METATYPE(KNSCore::EntryInternal)
#endif
KNSBackend::KNSBackend(QObject *parent, const QString &iconName, const QString &knsrc)
: AbstractResourcesBackend(parent)
......
......@@ -4,7 +4,7 @@ find_file(RpmOstreeDBusInterface org.projectatomic.rpmostree1.xml /usr/share/dbu
qt_add_dbus_interface(RpmOstreeDBusInterface_SRCS ${RpmOstreeDBusInterface} RpmOstreeDBusInterface)
add_library(rpm-ostree-backend MODULE RpmOstreeResource.cpp RpmOstreeBackend.cpp RpmOstreeSourcesBackend.cpp RpmOstreeTransaction.cpp RpmOstree.qrc ${RpmOstreeDBusInterface_SRCS})
target_link_libraries(rpm-ostree-backend PRIVATE Discover::Common Qt5::DBus KF5::CoreAddons KF5::I18n PkgConfig::Ostree)
target_link_libraries(rpm-ostree-backend PRIVATE Discover::Common Qt::DBus KF5::CoreAddons KF5::I18n PkgConfig::Ostree)
install(TARGETS rpm-ostree-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
install(FILES rpm-ostree-backend-categories.xml DESTINATION ${KDE_INSTALL_DATADIR}/libdiscover/categories)
......
......@@ -68,7 +68,7 @@ ResourcesModel::ResourcesModel(QObject *parent, bool load)
for (auto backend : qAsConst(m_backends)) {
sum += backend->fetchingUpdatesProgress();
}
return sum / m_backends.count();
return sum / (int)m_backends.count();
}
},
[this](int progress) {
......
......@@ -360,7 +360,13 @@ bool ResourcesProxyModel::lessThan(AbstractResource *leftPackage, AbstractResour
} else if (role == CanUpgrade) {
ret = leftValue.toBool();
} else {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ret = leftValue < rightValue;
#else
const auto order = QVariant::compare(leftValue, rightValue);
Q_ASSERT(order != QPartialOrdering::Unordered);
return order == QPartialOrdering::Less;
#endif
}
return ret != (order != Qt::AscendingOrder);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment