Commit 0a6c007f authored by Laurent Montel's avatar Laurent Montel 😁

Use KDEFrameworkCompilerSettings

parent e4a788d8
...@@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_ ...@@ -15,7 +15,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_CURRENT_
include(KDEInstallDirs) include(KDEInstallDirs)
include(KDECMakeSettings) include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary) include(FeatureSummary)
...@@ -70,8 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED ...@@ -70,8 +70,6 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
) )
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) 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(data)
add_subdirectory(src) add_subdirectory(src)
......
...@@ -51,7 +51,7 @@ AppChooserDialog::AppChooserDialog(const QStringList &choices, const QString &de ...@@ -51,7 +51,7 @@ AppChooserDialog::AppChooserDialog(const QStringList &choices, const QString &de
label->setOpenExternalLinks(false); label->setOpenExternalLinks(false);
connect(label, &QLabel::linkActivated, this, [] () { connect(label, &QLabel::linkActivated, this, [] () {
KProcess::startDetached("plasma-discover"); KProcess::startDetached(QStringLiteral("plasma-discover"));
}); });
vboxLayout->addWidget(label); vboxLayout->addWidget(label);
......
...@@ -29,10 +29,10 @@ ...@@ -29,10 +29,10 @@
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeFileChooser, "xdp-kde-file-chooser") Q_LOGGING_CATEGORY(XdgDesktopPortalKdeFileChooser, "xdp-kde-file-chooser")
// Keep in sync with qflatpakfiledialog from flatpak-platform-plugin // Keep in sync with qflatpakfiledialog from flatpak-platform-plugin
Q_DECLARE_METATYPE(FileChooserPortal::Filter); Q_DECLARE_METATYPE(FileChooserPortal::Filter)
Q_DECLARE_METATYPE(FileChooserPortal::Filters); Q_DECLARE_METATYPE(FileChooserPortal::Filters)
Q_DECLARE_METATYPE(FileChooserPortal::FilterList); Q_DECLARE_METATYPE(FileChooserPortal::FilterList)
Q_DECLARE_METATYPE(FileChooserPortal::FilterListList); Q_DECLARE_METATYPE(FileChooserPortal::FilterListList)
QDBusArgument &operator << (QDBusArgument &arg, const FileChooserPortal::Filter &filter) QDBusArgument &operator << (QDBusArgument &arg, const FileChooserPortal::Filter &filter)
{ {
...@@ -147,7 +147,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle, ...@@ -147,7 +147,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
} }
if (!filterStrings.isEmpty()) { 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, ...@@ -219,11 +219,11 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
} }
if (options.contains(QLatin1String("current_folder"))) { 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"))) { 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"))) { if (options.contains(QLatin1String("filters"))) {
...@@ -239,7 +239,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle, ...@@ -239,7 +239,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
} }
if (!filterStrings.isEmpty()) { 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(" ")));
} }
} }
} }
......
...@@ -88,7 +88,7 @@ void NotificationPortal::AddNotification(const QString &app_id, ...@@ -88,7 +88,7 @@ void NotificationPortal::AddNotification(const QString &app_id,
connect(notify, &KNotification::closed, this, &NotificationPortal::notificationClosed); connect(notify, &KNotification::closed, this, &NotificationPortal::notificationClosed);
notify->sendEvent(); 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) void NotificationPortal::notificationActivated(uint action)
...@@ -121,7 +121,7 @@ void NotificationPortal::RemoveNotification(const QString &app_id, ...@@ -121,7 +121,7 @@ void NotificationPortal::RemoveNotification(const QString &app_id,
qCDebug(XdgDesktopPortalKdeNotification) << " app_id: " << app_id; qCDebug(XdgDesktopPortalKdeNotification) << " app_id: " << app_id;
qCDebug(XdgDesktopPortalKdeNotification) << " id: " << 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) { if (notify) {
notify->close(); notify->close();
notify->deleteLater(); notify->deleteLater();
...@@ -139,6 +139,6 @@ void NotificationPortal::notificationClosed() ...@@ -139,6 +139,6 @@ void NotificationPortal::notificationClosed()
const QString appId = notify->property("app_id").toString(); const QString appId = notify->property("app_id").toString();
const QString id = notify->property("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(); notify->deleteLater();
} }
...@@ -633,7 +633,7 @@ uint PrintPortal::PreparePrint(const QDBusObjectPath &handle, ...@@ -633,7 +633,7 @@ uint PrintPortal::PreparePrint(const QDBusObjectPath &handle,
resultingSettings.insert(QLatin1String("print-pages"), QLatin1String("current")); resultingSettings.insert(QLatin1String("print-pages"), QLatin1String("current"));
} else if (printer->printRange() == QPrinter::PageRange) { } else if (printer->printRange() == QPrinter::PageRange) {
resultingSettings.insert(QLatin1String("print-pages"), QLatin1String("ranges")); 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 // Set cups specific properties
const QStringList cupsOptions = printer->printEngine()->property(PPK_CupsOptions).toStringList(); const QStringList cupsOptions = printer->printEngine()->property(PPK_CupsOptions).toStringList();
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeScreenshot, "xdp-kde-screenshot") Q_LOGGING_CATEGORY(XdgDesktopPortalKdeScreenshot, "xdp-kde-screenshot")
// Keep in sync with qflatpakcolordialog from Qt flatpak platform theme // 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) QDBusArgument &operator <<(QDBusArgument &arg, const ScreenshotPortal::ColorRGB &color)
{ {
......
...@@ -72,7 +72,7 @@ static QImage readImage(int pipeFd) ...@@ -72,7 +72,7 @@ static QImage readImage(int pipeFd)
QImage image; QImage image;
ds >> image; ds >> image;
return image; return image;
}; }
ScreenshotDialog::ScreenshotDialog(QDialog *parent, Qt::WindowFlags flags) ScreenshotDialog::ScreenshotDialog(QDialog *parent, Qt::WindowFlags flags)
: QDialog(parent, flags) : QDialog(parent, flags)
......
Markdown is supported
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