[decorations] Introduce logging category for decorations

This commit is contained in:
Martin Gräßlin 2015-07-31 13:12:43 +02:00
parent 910c49959a
commit 09880d1267
7 changed files with 56 additions and 6 deletions

View file

@ -405,6 +405,7 @@ set(kwin_KDEINIT_SRCS
decorations/decorationpalette.cpp decorations/decorationpalette.cpp
decorations/settings.cpp decorations/settings.cpp
decorations/decorationrenderer.cpp decorations/decorationrenderer.cpp
decorations/decorations_logging.cpp
) )
if(KWIN_BUILD_TABBOX) if(KWIN_BUILD_TABBOX)

View file

@ -10,4 +10,5 @@ kwin_wayland_backend KWin Wayland (Wayland backend)
kwin_wayland_x11windowed KWin Wayland (X11 backend) kwin_wayland_x11windowed KWin Wayland (X11 backend)
kwin_libinput KWin Libinput Integration kwin_libinput KWin Libinput Integration
kwin_tabbox KWin Window Switcher kwin_tabbox KWin Window Switcher
kwin_decorations KWin Decorations
aurorae KWin Aurorae Window Decoration Engine aurorae KWin Aurorae Window Decoration Engine

View file

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "decorationbridge.h" #include "decorationbridge.h"
#include "decoratedclient.h" #include "decoratedclient.h"
#include "decorationrenderer.h" #include "decorationrenderer.h"
#include "decorations_logging.h"
#include "settings.h" #include "settings.h"
// KWin core // KWin core
#include "client.h" #include "client.h"
@ -37,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KPluginLoader> #include <KPluginLoader>
// Qt // Qt
#include <QDebug>
#include <QMetaProperty> #include <QMetaProperty>
#include <QPainter> #include <QPainter>
@ -97,14 +97,14 @@ void DecorationBridge::initPlugin()
{ {
const auto offers = KPluginLoader::findPluginsById(s_pluginName, m_plugin); const auto offers = KPluginLoader::findPluginsById(s_pluginName, m_plugin);
if (offers.isEmpty()) { if (offers.isEmpty()) {
qWarning() << "Could not locate decoration plugin"; qCWarning(KWIN_DECORATIONS) << "Could not locate decoration plugin";
return; return;
} }
qDebug() << "Trying to load decoration plugin: " << offers.first().fileName(); qCDebug(KWIN_DECORATIONS) << "Trying to load decoration plugin: " << offers.first().fileName();
KPluginLoader loader(offers.first().fileName()); KPluginLoader loader(offers.first().fileName());
KPluginFactory *factory = loader.factory(); KPluginFactory *factory = loader.factory();
if (!factory) { if (!factory) {
qWarning() << "Error loading plugin:" << loader.errorString(); qCWarning(KWIN_DECORATIONS) << "Error loading plugin:" << loader.errorString();
} else { } else {
m_factory = factory; m_factory = factory;
loadMetaData(loader.metaData().value(QStringLiteral("MetaData")).toObject()); loadMetaData(loader.metaData().value(QStringLiteral("MetaData")).toObject());

View file

@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include "decorationpalette.h" #include "decorationpalette.h"
#include "decorations_logging.h"
#include <KConfigGroup> #include <KConfigGroup>
#include <KSharedConfig> #include <KSharedConfig>
@ -29,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPalette> #include <QPalette>
#include <QFileInfo> #include <QFileInfo>
#include <QStandardPaths> #include <QStandardPaths>
#include <QDebug>
namespace KWin namespace KWin
{ {
@ -116,7 +116,7 @@ void DecorationPalette::update()
KConfigGroup wmConfig(config, QStringLiteral("WM")); KConfigGroup wmConfig(config, QStringLiteral("WM"));
if (!wmConfig.exists() && !m_colorScheme.endsWith(QStringLiteral("/kdeglobals"))) { if (!wmConfig.exists() && !m_colorScheme.endsWith(QStringLiteral("/kdeglobals"))) {
qWarning() << "Invalid color scheme" << m_colorScheme << "lacks WM group"; qCWarning(KWIN_DECORATIONS) << "Invalid color scheme" << m_colorScheme << "lacks WM group";
return; return;
} }

View file

@ -0,0 +1,21 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#include "decorations_logging.h"
Q_LOGGING_CATEGORY(KWIN_DECORATIONS, "kwin_decorations", QtCriticalMsg);

View file

@ -0,0 +1,26 @@
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2015 Martin Gräßlin <mgraesslin@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
#ifndef KWIN_DECORATIONS_LOGGING_H
#define KWIN_DECORATIONS_LOGGING_H
#include <QDebug>
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KWIN_DECORATIONS)
#endif

View file

@ -7,6 +7,7 @@ set(plugin_SRCS
plugin.cpp plugin.cpp
buttonsmodel.cpp buttonsmodel.cpp
../../../decorations/decorationpalette.cpp ../../../decorations/decorationpalette.cpp
../../../decorations/decorations_logging.cpp
) )
add_library(kdecorationprivatedeclarative SHARED ${plugin_SRCS}) add_library(kdecorationprivatedeclarative SHARED ${plugin_SRCS})