Commit fe4d331e authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

port to ECMQtDeclareLoggingCategory

this is more in line with other KDE software, albeit a bit noisy in our
case since we have so many categories.

the change also implicitly pushes the default logging from debug level
to info level, reducing the unnecessary logging noise generated by the
portals

BUG: 455613
parent 826878ef
Pipeline #193195 passed with stage
in 1 minute and 7 seconds
......@@ -25,6 +25,7 @@ include(KDEClangFormat)
include(KDEGitCommitHooks)
include(ECMSetupVersion)
include(ECMConfiguredInstall)
include(ECMQtDeclareLoggingCategory)
include(FeatureSummary)
......
......@@ -71,6 +71,103 @@ set(xdg_desktop_portal_kde_SRCS
dynamiclauncherdialog.cpp
)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeBackground"
CATEGORY_NAME "xdp-kde-background"
HEADER background_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeNotificationInhibition"
CATEGORY_NAME "xdp-kde-notificationinhibition"
HEADER notificationinhibition_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeAccess"
CATEGORY_NAME "xdp-kde-access"
HEADER access_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeAccount"
CATEGORY_NAME "xdp-kde-account"
HEADER account_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeSettings"
CATEGORY_NAME "xdp-kde-settings"
HEADER settings_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeAppChooser"
CATEGORY_NAME "xdp-kde-app-chooser"
HEADER appchooser_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeDesktopPortal"
CATEGORY_NAME "xdp-kde-desktop-portal"
HEADER desktopportal_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeDynamicLauncher"
CATEGORY_NAME "xdp-kde-dynamic-launcher"
HEADER dynamiclauncher_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeDynamicLauncherDialog"
CATEGORY_NAME "xdp-kde-dynamic-launcher-dialog"
HEADER dynamiclauncherdialog_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeEmail"
CATEGORY_NAME "xdp-kde-email"
HEADER email_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeFileChooser"
CATEGORY_NAME "xdp-kde-file-chooser"
HEADER filechooser_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeInhibit"
CATEGORY_NAME "xdp-kde-inhibit"
HEADER inhibit_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeNotification"
CATEGORY_NAME "xdp-kde-notification"
HEADER notification_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdePrint"
CATEGORY_NAME "xdp-kde-print"
HEADER print_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeRemoteDesktop"
CATEGORY_NAME "xdp-kde-remotedesktop"
HEADER remotedesktop_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeRemoteDesktopDialog"
CATEGORY_NAME "xdp-kde-remote-desktop-dialog"
HEADER remotedesktopdialog_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgRequestKdeRequest"
CATEGORY_NAME "xdp-kde-request"
HEADER request_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeScreenCast"
CATEGORY_NAME "xdp-kde-screencast"
HEADER screencast_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeScreenshot"
CATEGORY_NAME "xdp-kde-screenshot"
HEADER screenshot_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeScreenshotDialog"
CATEGORY_NAME "xdp-kde-screenshot-dialog"
HEADER screenshotdialog_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgSessionKdeSession"
CATEGORY_NAME "xdp-kde-session"
HEADER session_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKde"
CATEGORY_NAME "xdp-kde"
HEADER debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeWaylandIntegration"
CATEGORY_NAME "xdp-kde-wayland-integration"
HEADER waylandintegration_debug.h)
ecm_qt_declare_logging_category(xdg_desktop_portal_kde_SRCS
IDENTIFIER "XdgDesktopPortalKdeAccessDialog"
CATEGORY_NAME "xdp-kde-access-dialog"
HEADER accessdialog_debug.h)
if (QT_MAJOR_VERSION EQUAL "5")
ecm_add_qtwayland_client_protocol(xdg_desktop_portal_kde_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml
......
......@@ -7,15 +7,13 @@
*/
#include "access.h"
#include "access_debug.h"
#include "accessdialog.h"
#include "request.h"
#include "utils.h"
#include <QLoggingCategory>
#include <QWindow>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAccess, "xdp-kde-access")
AccessPortal::AccessPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -7,15 +7,13 @@
*/
#include "accessdialog.h"
#include "accessdialog_debug.h"
#include "utils.h"
#include <KLocalizedString>
#include <QLoggingCategory>
#include <QPushButton>
#include <QStandardPaths>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAccessDialog, "xdp-kde-access-dialog")
AccessDialog::AccessDialog(QObject *parent)
: QuickDialog(parent)
{
......
......@@ -6,13 +6,10 @@
*/
#include "account.h"
#include "account_debug.h"
#include "userinfodialog.h"
#include "utils.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAccount, "xdp-kde-account")
AccountPortal::AccountPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -7,14 +7,11 @@
*/
#include "appchooser.h"
#include "appchooser_debug.h"
#include "appchooserdialog.h"
#include "request.h"
#include "utils.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAppChooser, "xdp-kde-app-chooser")
AppChooserPortal::AppChooserPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -6,6 +6,7 @@
*/
#include "background.h"
#include "background_debug.h"
#include "utils.h"
#include "waylandintegration.h"
......@@ -16,7 +17,6 @@
#include <QDir>
#include <QFile>
#include <QLoggingCategory>
#include <QMessageBox>
#include <QPushButton>
#include <QSettings>
......@@ -31,8 +31,6 @@
#include <KWayland/Client/plasmawindowmanagement.h>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeBackground, "xdp-kde-background")
BackgroundPortal::BackgroundPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -7,13 +7,10 @@
*/
#include "desktopportal.h"
#include <QLoggingCategory>
#include "desktopportal_debug.h"
#include "dynamiclauncher.h"
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeDesktopPortal, "xdp-kde-desktop-portal")
DesktopPortal::DesktopPortal(QObject *parent)
: QObject(parent)
, m_access(new AccessPortal(this))
......
......@@ -7,20 +7,18 @@
#include <QFile>
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QUrl>
#include <QWindow>
#include <KIconLoader>
#include <KLocalizedString>
#include "dynamiclauncher_debug.h"
#include "dynamiclauncherdialog.h"
#include "portalicon.h"
#include "request.h"
#include "utils.h"
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeDynamicLauncher, "xdp-kde-dynamic-launcher")
DynamicLauncherPortal::DynamicLauncherPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -4,9 +4,8 @@
#include "dynamiclauncherdialog.h"
#include <QIcon>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeDynamicLauncherDialog, "xdp-kde-dynamic-launcher-dialog")
#include "dynamiclauncherdialog_debug.h"
DynamicLauncherDialog::DynamicLauncherDialog(const QString &title, const QIcon &icon, const QString &name, const QUrl &launcherURL, QObject *parent)
: QuickDialog(parent)
......
......@@ -7,14 +7,12 @@
*/
#include "email.h"
#include "email_debug.h"
#include <QLoggingCategory>
#include <QUrl>
#include <KEMailClientLauncherJob>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeEmail, "xdp-kde-email")
EmailPortal::EmailPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -8,6 +8,7 @@
*/
#include "filechooser.h"
#include "filechooser_debug.h"
#include "utils.h"
#include <QDBusArgument>
......@@ -18,7 +19,6 @@
#include <QFileInfo>
#include <QGridLayout>
#include <QLabel>
#include <QLoggingCategory>
#include <QPushButton>
#include <QQmlApplicationEngine>
#include <QStandardPaths>
......@@ -37,8 +37,6 @@
#include "request.h"
#include <mobilefiledialog.h>
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)
......
......@@ -7,15 +7,13 @@
*/
#include "inhibit.h"
#include "inhibit_debug.h"
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDBusPendingCall>
#include <QDBusPendingCallWatcher>
#include <QDBusPendingReply>
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeInhibit, "xdp-kde-inhibit")
InhibitPortal::InhibitPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
......
......@@ -12,6 +12,11 @@ set(filepicker_lib_SRCS
declarative/filepicker.qrc
)
ecm_qt_declare_logging_category(filepicker_lib_SRCS
IDENTIFIER "KirigamiFilepicker"
CATEGORY_NAME "xdp-kde-file-chooser"
HEADER mobilefiledialog_debug.h)
add_library(KirigamiFilepicker STATIC ${filepicker_lib_SRCS})
target_include_directories(KirigamiFilepicker PRIVATE declarative)
target_link_libraries(KirigamiFilepicker
......
......@@ -5,7 +5,6 @@
#include "mobilefiledialog.h"
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickWindow>
......@@ -17,13 +16,12 @@
#include "dirmodel.h"
#include "dirmodelutils.h"
#include "fileplacesmodel.h"
#include "mobilefiledialog_debug.h"
#include "filechooserqmlcallback.h"
constexpr auto URI = "org.kde.kirigamifilepicker";
Q_LOGGING_CATEGORY(KirigamiFilepicker, "xdp-kde-file-chooser")
MobileFileDialog::MobileFileDialog(QObject *parent)
: QObject(parent)
, m_engine(new QQmlApplicationEngine(this))
......
......@@ -11,12 +11,10 @@
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDBusMetaType>
#include <QLoggingCategory>
#include "notification_debug.h"
#include "portalicon.h"
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeNotification, "xdp-kde-notification")
NotificationPortal::NotificationPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -5,17 +5,15 @@
*/
#include "notificationinhibition.h"
#include "notificationinhibition_debug.h"
#include <QDBusConnection>
#include <QDBusMessage>
#include <QDBusPendingCall>
#include <QDBusPendingCallWatcher>
#include <QDBusPendingReply>
#include <QLoggingCategory>
#include <QPointer>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeNotificationInhibition, "xdp-kde-notificationinhibition")
static const auto s_notificationService = QStringLiteral("org.freedesktop.Notifications");
static const auto s_notificationPath = QStringLiteral("/org/freedesktop/Notifications");
static const auto s_notificationInterface = QStringLiteral("org.freedesktop.Notifications");
......
......@@ -9,13 +9,13 @@
*/
#include "print.h"
#include "print_debug.h"
#include "request.h"
#include "utils.h"
#include <KProcess>
#include <QFile>
#include <QLoggingCategory>
#include <QPrintDialog>
#include <QPrintEngine>
#include <QStandardPaths>
......@@ -24,8 +24,6 @@
#include <QUrl>
#include <QtPrintSupport/private/qcups_p.h>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdePrint, "xdp-kde-print")
// INFO: code below is copied from Qt as there is no public API for converting key to PageSizeId
// Standard sizes data
......
......@@ -8,16 +8,13 @@
*/
#include "remotedesktop.h"
#include "remotedesktop_debug.h"
#include "remotedesktopdialog.h"
#include "request.h"
#include "session.h"
#include "utils.h"
#include "waylandintegration.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeRemoteDesktop, "xdp-kde-remotedesktop")
RemoteDesktopPortal::RemoteDesktopPortal(QObject *parent)
: QDBusAbstractAdaptor(parent)
{
......
......@@ -7,17 +7,15 @@
*/
#include "remotedesktopdialog.h"
#include "remotedesktopdialog_debug.h"
#include "utils.h"
#include <KLocalizedString>
#include <QLoggingCategory>
#include <QPushButton>
#include <QSettings>
#include <QStandardPaths>
#include <QWindow>
Q_LOGGING_CATEGORY(XdgDesktopPortalKdeRemoteDesktopDialog, "xdp-kde-remote-desktop-dialog")
RemoteDesktopDialog::RemoteDesktopDialog(const QString &appName,
RemoteDesktopPortal::DeviceTypes deviceTypes,
bool screenSharingEnabled,
......
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