Commit a8cd6c3f authored by Ahmad Samir's avatar Ahmad Samir
Browse files

systemtray: use debug categories instead of plain qWarning()

Otherwise the system log is needlessly filled with e.g. "DBusMenu disabled
for this application" messages.

GIT_SILENT
parent 43cee102
Pipeline #136791 passed with stage
in 5 minutes and 27 seconds
......@@ -79,7 +79,7 @@ public:
}
if (!entry || !entry->isValid()) {
qWarning() << "Entry is not valid" << id << entry;
qCWarning(KICKER_DEBUG) << "Entry is not valid" << id << entry;
m_id = id;
return;
}
......@@ -498,14 +498,14 @@ void KAStatsFavoritesModel::setEnabled(bool enable)
QStringList KAStatsFavoritesModel::favorites() const
{
qWarning() << "KAStatsFavoritesModel::favorites returns nothing, it is here just to keep the API backwards-compatible";
qCWarning(KICKER_DEBUG) << "KAStatsFavoritesModel::favorites returns nothing, it is here just to keep the API backwards-compatible";
return QStringList();
}
void KAStatsFavoritesModel::setFavorites(const QStringList &favorites)
{
Q_UNUSED(favorites);
qWarning() << "KAStatsFavoritesModel::setFavorites is ignored";
qCWarning(KICKER_DEBUG) << "KAStatsFavoritesModel::setFavorites is ignored";
}
bool KAStatsFavoritesModel::isFavorite(const QString &id) const
......
......@@ -248,7 +248,7 @@ void PlaceholderModel::connectSignals()
connect(sourceModelPtr, &QAbstractItemModel::rowsAboutToBeInserted, this, [this](const QModelIndex &parent, int from, int to) {
if (parent.isValid()) {
qWarning() << "We do not support tree models";
qCWarning(KICKER_DEBUG) << "We do not support tree models";
} else {
beginInsertRows(QModelIndex(), sourceRowToRow(from), sourceRowToRow(to));
......@@ -265,7 +265,7 @@ void PlaceholderModel::connectSignals()
this,
[this](const QModelIndex &source, int from, int to, const QModelIndex &dest, int destRow) {
if (source.isValid() || dest.isValid()) {
qWarning() << "We do not support tree models";
qCWarning(KICKER_DEBUG) << "We do not support tree models";
} else {
beginMoveRows(QModelIndex(), sourceRowToRow(from), sourceRowToRow(to), QModelIndex(), sourceRowToRow(destRow));
......@@ -278,7 +278,7 @@ void PlaceholderModel::connectSignals()
connect(sourceModelPtr, &QAbstractItemModel::rowsAboutToBeRemoved, this, [this](const QModelIndex &parent, int from, int to) {
if (parent.isValid()) {
qWarning() << "We do not support tree models";
qCWarning(KICKER_DEBUG) << "We do not support tree models";
} else {
beginRemoveRows(QModelIndex(), sourceRowToRow(from), sourceRowToRow(to));
......
......@@ -10,6 +10,8 @@
#include "statusnotifieritemservice.h"
#include "systemtraytypes.h"
#include "debug.h"
#include <KIconEngine>
#include <KIconLoader>
#include <QApplication>
......@@ -63,7 +65,7 @@ StatusNotifierItemSource::StatusNotifierItemSource(const QString &notifierItemId
int slash = notifierItemId.indexOf('/');
if (slash == -1) {
qWarning() << "Invalid notifierItemId:" << notifierItemId;
qCWarning(SYSTEM_TRAY) << "Invalid notifierItemId:" << notifierItemId;
m_valid = false;
m_statusNotifierItemInterface = nullptr;
return;
......@@ -382,7 +384,7 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
// This is a hack to make it possible to disable DBusMenu in an
// application. The string "/NO_DBUSMENU" must be the same as in
// KStatusNotifierItem::setContextMenu().
qWarning() << "DBusMenu disabled for this application";
qCWarning(SYSTEM_TRAY) << "DBusMenu disabled for this application";
} else {
m_menuImporter = new PlasmaDBusMenuImporter(m_statusNotifierItemInterface->service(), menuObjectPath, iconLoader(), this);
connect(m_menuImporter, &PlasmaDBusMenuImporter::menuUpdated, this, [this](QMenu *menu) {
......@@ -535,7 +537,7 @@ void StatusNotifierItemSource::contextMenu(int x, int y)
if (m_menuImporter) {
m_menuImporter->updateMenu();
} else {
qWarning() << "Could not find DBusMenu interface, falling back to calling ContextMenu()";
qCWarning(SYSTEM_TRAY) << "Could not find DBusMenu interface, falling back to calling ContextMenu()";
if (m_statusNotifierItemInterface && m_statusNotifierItemInterface->isValid()) {
m_statusNotifierItemInterface->call(QDBus::NoBlock, QStringLiteral("ContextMenu"), x, y);
}
......
......@@ -335,7 +335,7 @@ void SystemTray::startApplet(const QString &pluginId)
// this should never happen unless explicitly wrong config is hand-written or
//(more likely) a previously added applet is uninstalled
if (!applet) {
qWarning() << "Unable to find applet" << pluginId;
qCWarning(SYSTEM_TRAY) << "Unable to find applet" << pluginId;
return;
}
applet->setProperty("org.kde.plasma:force-create", true);
......
......@@ -4,6 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "debug.h"
#include "startplasma.h"
#include <KConfig>
#include <KConfigGroup>
......@@ -54,7 +55,7 @@ int main(int argc, char **argv)
queryAndSet("XKB_DEFAULT_VARIANT", QStringLiteral("X11Variant"));
queryAndSet("XKB_DEFAULT_OPTIONS", QStringLiteral("X11Options"));
} else {
qWarning() << "not a reply org.freedesktop.locale1" << resultMessage;
qCWarning(PLASMA_STARTUP) << "not a reply org.freedesktop.locale1" << resultMessage;
}
}
runEnvironmentScripts();
......
......@@ -90,7 +90,7 @@ void gentleTermination(QProcess *p)
if (!p->waitForFinished(5000)) {
p->kill();
if (!p->waitForFinished(5000)) {
qWarning() << "Could not fully finish the process" << p->program();
qCWarning(PLASMA_STARTUP) << "Could not fully finish the process" << p->program();
}
}
}
......@@ -109,7 +109,7 @@ int runSync(const QString &program, const QStringList &args, const QStringList &
// qCDebug(PLASMA_STARTUP) << "started..." << program << args;
p.waitForFinished(-1);
if (p.exitCode()) {
qWarning() << program << args << "exited with code" << p.exitCode();
qCWarning(PLASMA_STARTUP) << program << args << "exited with code" << p.exitCode();
}
return p.exitCode();
}
......@@ -470,7 +470,7 @@ static void dropSessionVarsFromSystemdEnvironment()
msg << varsToDrop;
auto reply = QDBusConnection::sessionBus().call(msg);
if (reply.type() == QDBusMessage::ErrorMessage) {
qWarning() << "Failed to unset systemd environment variables:" << reply.errorName() << reply.errorMessage();
qCWarning(PLASMA_STARTUP) << "Failed to unset systemd environment variables:" << reply.errorName() << reply.errorMessage();
}
}
......@@ -703,7 +703,7 @@ bool startPlasmaSession(bool wayland)
msg << QStringLiteral("plasma-workspace-%1.target").arg(platform) << QStringLiteral("fail");
QDBusReply<QDBusObjectPath> reply = QDBusConnection::sessionBus().call(msg);
if (!reply.isValid()) {
qWarning() << "Could not start systemd managed Plasma session:" << reply.error().name() << reply.error().message();
qCWarning(PLASMA_STARTUP) << "Could not start systemd managed Plasma session:" << reply.error().name() << reply.error().message();
messageBox(QStringLiteral("startkde: Could not start Plasma session.\n"));
rc = false;
} else {
......
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