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_
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)
......
......@@ -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);
......
......@@ -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(" ")));
}
}
}
......
......@@ -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();
}
......@@ -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();
......
......@@ -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)
{
......
......@@ -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)
......
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