summaryrefslogtreecommitdiffstats
path: root/src/gui/platform/unix/qdesktopunixservices.cpp
diff options
context:
space:
mode:
authorDavid Redondo <[email protected]>2025-02-05 12:18:53 +0100
committerDavid Redondo <[email protected]>2025-02-25 19:31:00 +0100
commit3c8bc2721cce78cfb24a4483459c0d56cbc570b9 (patch)
tree008aaa60075d86d7aed879cc0bd9edea6cdc484e /src/gui/platform/unix/qdesktopunixservices.cpp
parent0770171dcda24a567d6f57b87fdd284011e56e16 (diff)
Add logging category for platform services
Rather than being hidden behind a compile time flag or uncategorized Change-Id: I3bc1781351220441134fb9815644e905273a1e40 Reviewed-by: Tor Arne Vestbø <[email protected]>
Diffstat (limited to 'src/gui/platform/unix/qdesktopunixservices.cpp')
-rw-r--r--src/gui/platform/unix/qdesktopunixservices.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gui/platform/unix/qdesktopunixservices.cpp b/src/gui/platform/unix/qdesktopunixservices.cpp
index be472414ee5..226bd338a2c 100644
--- a/src/gui/platform/unix/qdesktopunixservices.cpp
+++ b/src/gui/platform/unix/qdesktopunixservices.cpp
@@ -46,8 +46,6 @@ using namespace Qt::StringLiterals;
#if QT_CONFIG(multiprocess)
-enum { debug = 0 };
-
static inline QByteArray detectDesktopEnvironment()
{
const QByteArray xdgCurrentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
@@ -136,8 +134,7 @@ static inline bool launch(const QString &launcher, const QUrl &url,
{
const QString command = launcher + u' ' + QLatin1StringView(url.toEncoded());
- if (debug)
- qDebug("Launching %s", qPrintable(command));
+ qCDebug(lcQpaServices, "Launching %s", qPrintable(command));
#if !QT_CONFIG(process)
if (!xdgActivationToken.isEmpty())
qputenv("XDG_ACTIVATION_TOKEN", xdgActivationToken.toUtf8());
@@ -162,8 +159,7 @@ static inline bool launch(const QString &launcher, const QUrl &url,
}
# endif
if (!ok)
- qWarning("Launch failed (%s)", qPrintable(command));
-
+ qCWarning(lcQpaServices, "Launch failed (%s)", qPrintable(command));
return ok;
}
@@ -501,7 +497,7 @@ bool QDesktopUnixServices::openUrl(const QUrl &url)
if (m_webBrowser.isEmpty()
&& !detectWebBrowser(desktopEnvironment(), true, &m_webBrowser)) {
- qWarning("Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
+ qCWarning(lcQpaServices, "Unable to detect a web browser to launch '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_webBrowser, url, xdgActivationToken);
@@ -535,7 +531,7 @@ bool QDesktopUnixServices::openDocument(const QUrl &url)
if (m_documentLauncher.isEmpty()
&& !detectWebBrowser(desktopEnvironment(), false, &m_documentLauncher)) {
- qWarning("Unable to detect a launcher for '%s'", qPrintable(url.toString()));
+ qCWarning(lcQpaServices, "Unable to detect a launcher for '%s'", qPrintable(url.toString()));
return false;
}
return launch(m_documentLauncher, url, xdgActivationToken);
@@ -616,7 +612,7 @@ void QDesktopUnixServices::setApplicationBadge(qint64 number)
{
#if QT_CONFIG(dbus)
if (qGuiApp->desktopFileName().isEmpty()) {
- qWarning("QGuiApplication::desktopFileName() is empty");
+ qCWarning(lcQpaServices, "Cannot set badge number - QGuiApplication::desktopFileName() is empty");
return;
}