[tabbox] Add dedicated logging category for TabBox

master
Martin Gräßlin 9 years ago
parent fe28ca1d8a
commit 910c49959a

@ -417,6 +417,7 @@ if(KWIN_BUILD_TABBOX)
tabbox/switcheritem.cpp
tabbox/tabboxconfig.cpp
tabbox/tabboxhandler.cpp
tabbox/tabbox_logging.cpp
)
endif()

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

@ -8,6 +8,7 @@ set( testTabBoxClientModel_SRCS
../desktopmodel.cpp
../tabboxconfig.cpp
../tabboxhandler.cpp
../tabbox_logging.cpp
test_tabbox_clientmodel.cpp
mock_tabboxhandler.cpp
mock_tabboxclient.cpp
@ -36,6 +37,7 @@ set( testTabBoxHandler_SRCS
../desktopmodel.cpp
../tabboxconfig.cpp
../tabboxhandler.cpp
../tabbox_logging.cpp
test_tabbox_handler.cpp
mock_tabboxhandler.cpp
mock_tabboxclient.cpp
@ -61,6 +63,7 @@ ecm_mark_as_test(testTabBoxHandler)
########################################################
set( testTabBoxConfig_SRCS
../tabboxconfig.cpp
../tabbox_logging.cpp
test_tabbox_config.cpp
)
@ -75,6 +78,7 @@ ecm_mark_as_test(testTabBoxConfig)
########################################################
set( testDesktopChain_SRCS
../desktopchain.cpp
../tabbox_logging.cpp
test_desktopchain.cpp
)

@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "tabbox/desktopmodel.h"
#include "tabbox/tabboxconfig.h"
#include "tabbox/desktopchain.h"
#include "tabbox/tabbox_logging.h"
// kwin
#ifdef KWIN_BUILD_ACTIVITIES
#include "activities.h"
@ -44,7 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "xcbutils.h"
// Qt
#include <QAction>
#include <QDebug>
#include <QKeyEvent>
// KDE
#include <KConfig>
@ -754,7 +754,7 @@ void TabBox::hide(bool abort)
}
emit tabBoxClosed();
if (isDisplayed())
qDebug() << "Tab box was not properly closed by an effect";
qCDebug(KWIN_TABBOX) << "Tab box was not properly closed by an effect";
m_tabBox->hide(abort);
Xcb::sync();
}
@ -930,7 +930,7 @@ struct KeySymbolsDeleter
*/
static bool areKeySymXsDepressed(bool bAll, const uint keySyms[], int nKeySyms) {
qDebug() << "areKeySymXsDepressed: " << (bAll ? "all of " : "any of ") << nKeySyms;
qCDebug(KWIN_TABBOX) << "areKeySymXsDepressed: " << (bAll ? "all of " : "any of ") << nKeySyms;
Xcb::QueryKeymap keys;
@ -958,7 +958,7 @@ static bool areKeySymXsDepressed(bool bAll, const uint keySyms[], int nKeySyms)
if (i < 0 || i >= 32)
return false;
qDebug() << iKeySym << ": keySymX=0x" << QString::number(keySymX, 16)
qCDebug(KWIN_TABBOX) << iKeySym << ": keySymX=0x" << QString::number(keySymX, 16)
<< " i=" << i << " mask=0x" << QString::number(mask, 16)
<< " keymap[i]=0x" << QString::number(keymap[i], 16);
@ -1342,7 +1342,7 @@ void TabBox::keyPress(int keyQt)
backwardShortcut = m_cutWalkThroughCurrentAppWindowsAlternativeReverse;
break;
default:
qDebug() << "Invalid TabBoxMode";
qCDebug(KWIN_TABBOX) << "Invalid TabBoxMode";
return;
}
forward = contains(forwardShortcut, keyQt);
@ -1373,7 +1373,7 @@ void TabBox::keyPress(int keyQt)
}
}
if (forward || backward) {
qDebug() << "== " << forwardShortcut.toString()
qCDebug(KWIN_TABBOX) << "== " << forwardShortcut.toString()
<< " or " << backwardShortcut.toString();
KDEWalkThroughWindows(forward);
}

@ -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 "tabbox_logging.h"
Q_LOGGING_CATEGORY(KWIN_TABBOX, "kwin_tabbox", QtCriticalMsg);

@ -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_TABBOX_LOGGING_H
#define KWIN_TABBOX_LOGGING_H
#include <QDebug>
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KWIN_TABBOX)
#endif

@ -30,8 +30,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "thumbnailitem.h"
#include "scripting/scripting.h"
#include "switcheritem.h"
#include "tabbox_logging.h"
// Qt
#include <QDebug>
#include <QKeyEvent>
#include <QModelIndex>
#include <QStandardPaths>
@ -260,7 +260,7 @@ QObject *TabBoxHandlerPrivate::createSwitcherItem(bool desktopMode)
}
);
if (offers.isEmpty()) {
qDebug() << "could not find default window switcher layout";
qCDebug(KWIN_TABBOX) << "could not find default window switcher layout";
return KPluginMetaData();
}
}
@ -271,7 +271,7 @@ QObject *TabBoxHandlerPrivate::createSwitcherItem(bool desktopMode)
return nullptr;
}
if (service.value(QStringLiteral("X-Plasma-API")) != QStringLiteral("declarativeappletscript")) {
qDebug() << "Window Switcher Layout is no declarativeappletscript";
qCDebug(KWIN_TABBOX) << "Window Switcher Layout is no declarativeappletscript";
return nullptr;
}
auto findScriptFile = [desktopMode, service, folderName] {
@ -282,12 +282,12 @@ QObject *TabBoxHandlerPrivate::createSwitcherItem(bool desktopMode)
file = findScriptFile();
}
if (file.isNull()) {
qDebug() << "Could not find QML file for window switcher";
qCDebug(KWIN_TABBOX) << "Could not find QML file for window switcher";
return nullptr;
}
m_qmlComponent->loadUrl(QUrl::fromLocalFile(file));
if (m_qmlComponent->isError()) {
qDebug() << "Component failed to load: " << m_qmlComponent->errors();
qCDebug(KWIN_TABBOX) << "Component failed to load: " << m_qmlComponent->errors();
QStringList args;
args << QStringLiteral("--passivepopup") << i18n("The Window Switcher installation is broken, resources are missing.\n"
"Contact your distribution about this.") << QStringLiteral("20");

Loading…
Cancel
Save