From c6bccbf6de33ba907f1cddfa64dadb8cfeea4d2c Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 15 Mar 2022 13:30:13 +0100 Subject: [PATCH] Fix some compile error against qt6 --- CMakeLists.txt | 8 ++++---- src/CMakeLists.txt | 2 +- src/kitemviews/kfileitemmodel.cpp | 2 +- src/kitemviews/kstandarditemlistwidget.cpp | 4 ++++ src/trash/dolphintrash.h | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 021be0cf37..e19f6c2330 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS WindowSystem ) -find_package(KUserFeedback 1.0.0) +find_package(KUserFeedback 1.2.0) set_package_properties(KUserFeedback PROPERTIES TYPE OPTIONAL PURPOSE "Used for submission of telemetry data" @@ -91,13 +91,13 @@ set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities librari find_package(Phonon4Qt${QT_MAJOR_VERSION} CONFIG REQUIRED) -find_package(PackageKitQt5) -set_package_properties(PackageKitQt5 +find_package(PackageKitQt${QT_MAJOR_VERSION}) +set_package_properties(PackageKitQt${QT_MAJOR_VERSION} PROPERTIES DESCRIPTION "Software Manager integration" TYPE OPTIONAL PURPOSE "Used in the service menu installer" ) -if(PackageKitQt5_FOUND) +if(PackageKitQt${QT_MAJOR_VERSION}_FOUND) set(HAVE_PACKAGEKIT TRUE) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb898b5a75..2e8555cbcd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -307,7 +307,7 @@ target_link_libraries(dolphinstatic KF5::KCMUtils KF5::DBusAddons KF5::Notifications - Phonon::phonon4qt5 + Phonon::phonon4qt${QT_MAJOR_VERSION} ) if (HAVE_KACTIVITIES) diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 6391d7d3fa..052a71cbd4 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp index d04ef370bb..db4e4a90ed 100644 --- a/src/kitemviews/kstandarditemlistwidget.cpp +++ b/src/kitemviews/kstandarditemlistwidget.cpp @@ -1211,7 +1211,11 @@ QString KStandardItemListWidget::elideRightKeepExtension(const QString &text, in QString ret = m_customizedFontMetrics.elidedText(text.chopped(extensionLength), Qt::ElideRight, elidingWidth - extensionWidth); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) ret.append(text.rightRef(extensionLength)); +#else + ret.append(QStringView(text).right(extensionLength)); +#endif return ret; } } diff --git a/src/trash/dolphintrash.h b/src/trash/dolphintrash.h index 12f10f101e..2ee85e89a8 100644 --- a/src/trash/dolphintrash.h +++ b/src/trash/dolphintrash.h @@ -11,7 +11,7 @@ #include #include -#include +#include class Trash: public QObject {