diff --git a/CMakeLists.txt b/CMakeLists.txt index 04bf43f668c135b61c3ad970d60ed0ac6865e7e3..5e9c08cfd85e3e02b1abd3aa0581bb5377974a85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_ include(KDEInstallDirs) include(KDECMakeSettings) -include(KDECompilerSettings NO_POLICY_SCOPE) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) @@ -70,8 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED ) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) -add_definitions(-DQT_USE_FAST_OPERATOR_PLUS) -remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY) add_subdirectory(data) add_subdirectory(src) diff --git a/src/appchooserdialog.cpp b/src/appchooserdialog.cpp index e0af8c431a6dde3bee36b725ab07b0bdd989a15f..7d411e44c941e77089c717189e5db347f24b55d8 100644 --- a/src/appchooserdialog.cpp +++ b/src/appchooserdialog.cpp @@ -51,7 +51,7 @@ AppChooserDialog::AppChooserDialog(const QStringList &choices, const QString &de label->setOpenExternalLinks(false); connect(label, &QLabel::linkActivated, this, [] () { - KProcess::startDetached("plasma-discover"); + KProcess::startDetached(QStringLiteral("plasma-discover")); }); vboxLayout->addWidget(label); diff --git a/src/filechooser.cpp b/src/filechooser.cpp index 1685163e46bf8d18f8382a271cc41904f49fbefe..a2167eaa3165cad5c869b1d5d2db26f25a17414b 100644 --- a/src/filechooser.cpp +++ b/src/filechooser.cpp @@ -29,10 +29,10 @@ Q_LOGGING_CATEGORY(XdgDesktopPortalKdeFileChooser, "xdp-kde-file-chooser") // Keep in sync with qflatpakfiledialog from flatpak-platform-plugin -Q_DECLARE_METATYPE(FileChooserPortal::Filter); -Q_DECLARE_METATYPE(FileChooserPortal::Filters); -Q_DECLARE_METATYPE(FileChooserPortal::FilterList); -Q_DECLARE_METATYPE(FileChooserPortal::FilterListList); +Q_DECLARE_METATYPE(FileChooserPortal::Filter) +Q_DECLARE_METATYPE(FileChooserPortal::Filters) +Q_DECLARE_METATYPE(FileChooserPortal::FilterList) +Q_DECLARE_METATYPE(FileChooserPortal::FilterListList) QDBusArgument &operator << (QDBusArgument &arg, const FileChooserPortal::Filter &filter) { @@ -147,7 +147,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle, } if (!filterStrings.isEmpty()) { - nameFilters << QString("%1 (%2)").arg(filterList.userVisibleName).arg(filterStrings.join(QLatin1String(" "))); + nameFilters << QStringLiteral("%1 (%2)").arg(filterList.userVisibleName).arg(filterStrings.join(QLatin1String(" "))); } } } @@ -219,11 +219,11 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle, } if (options.contains(QLatin1String("current_folder"))) { - currentFolder = options.value(QLatin1String("current_folder")).toByteArray(); + currentFolder = QString::fromUtf8(options.value(QLatin1String("current_folder")).toByteArray()); } if (options.contains(QLatin1String("current_file"))) { - currentFile = options.value(QLatin1String("current_file")).toByteArray(); + currentFile = QString::fromUtf8(options.value(QLatin1String("current_file")).toByteArray()); } if (options.contains(QLatin1String("filters"))) { @@ -239,7 +239,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle, } if (!filterStrings.isEmpty()) { - nameFilters << QString("%1 (%2)").arg(filterList.userVisibleName).arg(filterStrings.join(QLatin1String(" "))); + nameFilters << QStringLiteral("%1 (%2)").arg(filterList.userVisibleName).arg(filterStrings.join(QLatin1String(" "))); } } } diff --git a/src/notification.cpp b/src/notification.cpp index 046008e05dd1148f0f20bd5ef745eb153670e682..08c88fbc88186b444ce3b5d9ca2403b6858b9e65 100644 --- a/src/notification.cpp +++ b/src/notification.cpp @@ -88,7 +88,7 @@ void NotificationPortal::AddNotification(const QString &app_id, connect(notify, &KNotification::closed, this, &NotificationPortal::notificationClosed); notify->sendEvent(); - m_notifications.insert(QString("%1:%2").arg(app_id, id), notify); + m_notifications.insert(QStringLiteral("%1:%2").arg(app_id, id), notify); } void NotificationPortal::notificationActivated(uint action) @@ -121,7 +121,7 @@ void NotificationPortal::RemoveNotification(const QString &app_id, qCDebug(XdgDesktopPortalKdeNotification) << " app_id: " << app_id; qCDebug(XdgDesktopPortalKdeNotification) << " id: " << id; - KNotification *notify = m_notifications.take(QString("%1:%2").arg(app_id, id)); + KNotification *notify = m_notifications.take(QStringLiteral("%1:%2").arg(app_id, id)); if (notify) { notify->close(); notify->deleteLater(); @@ -139,6 +139,6 @@ void NotificationPortal::notificationClosed() const QString appId = notify->property("app_id").toString(); const QString id = notify->property("id").toString(); - m_notifications.remove(QString("%1:%2").arg(appId, id)); + m_notifications.remove(QStringLiteral("%1:%2").arg(appId, id)); notify->deleteLater(); } diff --git a/src/print.cpp b/src/print.cpp index 2fca78ff69c2693758b8af2db588183f32f9d113..f9f657b19f997fa5514ff98629cd2bf28ca94e88 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -633,7 +633,7 @@ uint PrintPortal::PreparePrint(const QDBusObjectPath &handle, resultingSettings.insert(QLatin1String("print-pages"), QLatin1String("current")); } else if (printer->printRange() == QPrinter::PageRange) { resultingSettings.insert(QLatin1String("print-pages"), QLatin1String("ranges")); - resultingSettings.insert(QLatin1String("page-ranges"), QString("%1-%2").arg(printer->fromPage()).arg(printer->toPage())); + resultingSettings.insert(QLatin1String("page-ranges"), QStringLiteral("%1-%2").arg(printer->fromPage()).arg(printer->toPage())); } // Set cups specific properties const QStringList cupsOptions = printer->printEngine()->property(PPK_CupsOptions).toStringList(); diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 782e7bb781dc4fa7b0e0420963ef9f0dc67b5982..5f52d1ab4d3980be881d0e2369f7532a2d46b93b 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -34,7 +34,7 @@ Q_LOGGING_CATEGORY(XdgDesktopPortalKdeScreenshot, "xdp-kde-screenshot") // Keep in sync with qflatpakcolordialog from Qt flatpak platform theme -Q_DECLARE_METATYPE(ScreenshotPortal::ColorRGB); +Q_DECLARE_METATYPE(ScreenshotPortal::ColorRGB) QDBusArgument &operator <<(QDBusArgument &arg, const ScreenshotPortal::ColorRGB &color) { diff --git a/src/screenshotdialog.cpp b/src/screenshotdialog.cpp index 73d2df1ea7a805dfba86385038d1e0fc6f3475cf..c878d8cca61eedb814c1dc7ad4b3953fb011cbbf 100644 --- a/src/screenshotdialog.cpp +++ b/src/screenshotdialog.cpp @@ -72,7 +72,7 @@ static QImage readImage(int pipeFd) QImage image; ds >> image; return image; -}; +} ScreenshotDialog::ScreenshotDialog(QDialog *parent, Qt::WindowFlags flags) : QDialog(parent, flags)