[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-desktop/andriy/keyboard] kcms/keyboard: port kDebug to qCDebug
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2014-10-05 22:16:48
Message-ID: E1Xau6i-0002gM-IO () scm ! kde ! org
[Download RAW message or body]

Git commit 8e4a77d3a46f6072477fa48c538a61bb8816d99b by Andriy Rysin.
Committed on 05/10/2014 at 20:23.
Pushed by rysin into branch 'andriy/keyboard'.

port kDebug to qCDebug

M  +4    -5    kcms/keyboard/bindings.cpp
M  +3    -0    kcms/keyboard/bindings.h
M  +8    -6    kcms/keyboard/flags.cpp
M  +3    -0    kcms/keyboard/flags.h
M  +3    -4    kcms/keyboard/iso_codes.cpp
M  +7    -3    kcms/keyboard/iso_codes.h
M  +0    -1    kcms/keyboard/kcm_keyboard.cpp
M  +1    -2    kcms/keyboard/kcm_keyboard_widget.cpp
M  +3    -0    kcms/keyboard/kcm_keyboard_widget.h
M  +1    -2    kcms/keyboard/keyboard_config.cpp
M  +4    -0    kcms/keyboard/keyboard_config.h
M  +2    -3    kcms/keyboard/keyboard_daemon.cpp
M  +3    -0    kcms/keyboard/keyboard_daemon.h
M  +2    -2    kcms/keyboard/keyboard_hardware.cpp
M  +10   -11   kcms/keyboard/layout_memory.cpp
M  +5    -0    kcms/keyboard/layout_memory.h
M  +16   -14   kcms/keyboard/layout_memory_persister.cpp
M  +5    -1    kcms/keyboard/layout_memory_persister.h
M  +0    -1    kcms/keyboard/layout_tray_icon.cpp
M  +0    -1    kcms/keyboard/layout_widget.cpp
M  +1    -2    kcms/keyboard/layouts_menu.cpp
M  +19   -16   kcms/keyboard/preview/geometry_components.cpp
M  +4    -0    kcms/keyboard/preview/geometry_components.h
M  +9    -9    kcms/keyboard/preview/geometry_parser.cpp
M  +8    -9    kcms/keyboard/preview/kbpreviewframe.cpp
M  +5    -0    kcms/keyboard/preview/kbpreviewframe.h
M  +4    -4    kcms/keyboard/preview/keyboardlayout.cpp
M  +5    -0    kcms/keyboard/preview/keyboardlayout.h
M  +3    -3    kcms/keyboard/preview/keysymhelper.cpp
M  +12   -12   kcms/keyboard/preview/symbol_parser.cpp
M  +0    -1    kcms/keyboard/tests/flags_test.cpp
M  +1    -0    kcms/keyboard/tests/geometry_parser_test.cpp
M  +2    -1    kcms/keyboard/tests/iso_codes_test.cpp
M  +0    -1    kcms/keyboard/tests/keyboard_daemon_test.cpp
M  +0    -1    kcms/keyboard/tests/layout_memory_persister_test.cpp
M  +5    -2    kcms/keyboard/tests/xkb_rules_test.cpp
M  +11   -9    kcms/keyboard/x11_helper.cpp
M  +4    -0    kcms/keyboard/x11_helper.h
M  +5    -5    kcms/keyboard/xinput_helper.cpp
M  +6    -0    kcms/keyboard/xinput_helper.h
M  +3    -3    kcms/keyboard/xkb_helper.cpp
M  +20   -19   kcms/keyboard/xkb_rules.cpp
M  +6    -3    kcms/keyboard/xkb_rules.h

http://commits.kde.org/plasma-desktop/8e4a77d3a46f6072477fa48c538a61bb8816d99b

diff --git a/kcms/keyboard/bindings.cpp b/kcms/keyboard/bindings.cpp
index 14225ea..a11941f 100644
--- a/kcms/keyboard/bindings.cpp
+++ b/kcms/keyboard/bindings.cpp
@@ -18,7 +18,6 @@
 
 #include "bindings.h"
 
-#include <kdebug.h>
 #include <kactioncollection.h>
 #include <kaction.h>
 #include <klocalizedstring.h>
@@ -109,7 +108,7 @@ void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit>& layou
 			createLayoutShortcutActon(layoutUnit, rules, false);
 		}
 	}
-	kDebug() << "Cleaning component shortcuts on save" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
+	qCDebug(KCM_KEYBOARD) << "Cleaning component shortcuts on save" << \
KGlobalAccel::cleanComponent(COMPONENT_NAME);  }
 
 void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit>& layoutUnits, const Rules* \
rules) @@ -119,15 +118,15 @@ void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit>& \
layo  QAction* action = createLayoutShortcutActon(layoutUnit, rules, true);
                 const auto shortcut = KGlobalAccel::self()->shortcut(action);
 		if( ! shortcut.isEmpty() ) {
-			kDebug() << "Restored shortcut for" << layoutUnit.toString() << shortcut.first();
+			qCDebug(KCM_KEYBOARD, ) << "Restored shortcut for" << layoutUnit.toString() << shortcut.first();
 			layoutUnit.setShortcut(shortcut.first());
 		}
 		else {
-			kDebug() << "Skipping empty shortcut for" << layoutUnit.toString();
+			qCDebug(KCM_KEYBOARD, ) << "Skipping empty shortcut for" << layoutUnit.toString();
 			removeAction(action);
 		}
 	}
-	kDebug() << "Cleaning component shortcuts on load" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
+	qCDebug(KCM_KEYBOARD) << "Cleaning component shortcuts on load" << \
KGlobalAccel::cleanComponent(COMPONENT_NAME);  }
 
 //KAction* KeyboardLayoutActionCollection::getAction(const LayoutUnit& layoutUnit)
diff --git a/kcms/keyboard/bindings.h b/kcms/keyboard/bindings.h
index c576455..d597907 100644
--- a/kcms/keyboard/bindings.h
+++ b/kcms/keyboard/bindings.h
@@ -21,6 +21,9 @@
 #define BINDINGS_H_
 
 #include <kactioncollection.h>
+#include <QLoggingCategory>
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
 
 
 //class QObject;
diff --git a/kcms/keyboard/flags.cpp b/kcms/keyboard/flags.cpp
index 55b85b7..7bbcbf7 100644
--- a/kcms/keyboard/flags.cpp
+++ b/kcms/keyboard/flags.cpp
@@ -18,8 +18,6 @@
 
 #include "flags.h"
 
-#include <kdebug.h>
-#include <kstandarddirs.h>
 #include <kiconloader.h>
 #include <kglobalsettings.h>
 #include <klocalizedstring.h>
@@ -27,6 +25,7 @@
 #include <plasma/svg.h>
 #include <plasma/theme.h>
 
+#include <QStandardPaths>
 #include <QStringList>
 #include <QPixmap>
 #include <QPainter>
@@ -41,6 +40,9 @@
 #include "xkb_rules.h"
 
 
+//Q_LOGGING_CATEGORY(KCM_KEYBOARD, "kcm_keyboard")
+
+
 static const int FLAG_MAX_WIDTH = 21;
 static const int FLAG_MAX_HEIGHT = 14;
 static const char flagTemplate[] = "kf5/locale/countries/%1/flag.png";
@@ -74,14 +76,14 @@ QIcon Flags::createIcon(const QString& layout)
 	QIcon icon;
 	if( ! layout.isEmpty() ) {
 		if( layout == "epo" ) {
-			QString file = KStandardDirs::locate("data", "kcmkeyboard/pics/epo.png");
+			QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
"kcmkeyboard/pics/epo.png");  icon.addFile(file);
 		}
 		else {
 			QString countryCode = getCountryFromLayoutName( layout );
 			if( ! countryCode.isEmpty() ) {
 				QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, \
                QString(flagTemplate).arg(countryCode));
-				//			kDebug() << "Creating icon for" << layout << "with" << file;
+				//			qCDebug(KCM_KEYBOARD, ) << "Creating icon for" << layout << "with" << file;
 				icon.addFile(file);
 			}
 		}
@@ -313,13 +315,13 @@ Plasma::Svg* Flags::getSvg()
 
 void Flags::themeChanged()
 {
-//	kDebug() << "Theme changed, new text color" << \
Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor); +//	qCDebug(KCM_KEYBOARD, ) << "Theme \
changed, new text color" << Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);  \
clearCache();  emit pixmapChanged();
 }
 
 void Flags::clearCache()
 {
-//	kDebug() << "Clearing flag pixmap cache";
+//	qCDebug(KCM_KEYBOARD, ) << "Clearing flag pixmap cache";
 	iconOrTextMap.clear();
 }
diff --git a/kcms/keyboard/flags.h b/kcms/keyboard/flags.h
index 06ec831..3957a98 100644
--- a/kcms/keyboard/flags.h
+++ b/kcms/keyboard/flags.h
@@ -24,6 +24,9 @@
 #include <QtCore/QString>
 #include <QtCore/QMap>
 
+
+//Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
 class QPixmap;
 class QIcon;
 class LayoutUnit;
diff --git a/kcms/keyboard/iso_codes.cpp b/kcms/keyboard/iso_codes.cpp
index 7ada5c7..b2de07d 100644
--- a/kcms/keyboard/iso_codes.cpp
+++ b/kcms/keyboard/iso_codes.cpp
@@ -20,7 +20,6 @@
 
 #include <kglobal.h>
 #include <klocale.h>
-#include <kdebug.h>
 
 #include <QtXml/QXmlAttributes>
 
@@ -118,7 +117,7 @@ void IsoCodesPrivate::buildIsoEntryList()
 
 	QFile file(QString("%1/iso_%2.xml").arg(isoCodesXmlDir, isoCode));
 	if( !file.open(QFile::ReadOnly | QFile::Text) ) {
-		kError() << "Can't open the xml file" << file.fileName();
+		qCritical() << "Can't open the xml file" << file.fileName();
 		return;
 	}
 
@@ -131,9 +130,9 @@ void IsoCodesPrivate::buildIsoEntryList()
 	QXmlInputSource xmlInputSource(&file);
 
 	if( ! reader.parse(xmlInputSource) ) {
-		kError() << "Failed to parse the xml file" << file.fileName();
+		qCritical() << "Failed to parse the xml file" << file.fileName();
 		return;
 	}
 
-	kDebug() << "Loaded" << isoEntryList.count() << ("iso entry definitions for iso"+isoCode) << "from" << \
file.fileName(); +	qCDebug(KCM_KEYBOARD) << "Loaded" << isoEntryList.count() << ("iso entry definitions \
for iso"+isoCode) << "from" << file.fileName();  }
diff --git a/kcms/keyboard/iso_codes.h b/kcms/keyboard/iso_codes.h
index 10b4ed5..49ad252 100644
--- a/kcms/keyboard/iso_codes.h
+++ b/kcms/keyboard/iso_codes.h
@@ -20,9 +20,13 @@
 #ifndef ISO_CODES_H_
 #define ISO_CODES_H_
 
-#include <QtCore/QString>
-#include <QtCore/QList>
-#include <QtCore/QMap>
+#include <QString>
+#include <QList>
+#include <QMap>
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
 
 
 /**
diff --git a/kcms/keyboard/kcm_keyboard.cpp b/kcms/keyboard/kcm_keyboard.cpp
index 66ec89a..b82c9df 100644
--- a/kcms/keyboard/kcm_keyboard.cpp
+++ b/kcms/keyboard/kcm_keyboard.cpp
@@ -19,7 +19,6 @@
 
 #include "kcm_keyboard.h"
 
-#include <kdebug.h>
 #include <kaboutdata.h>
 #include <kpluginfactory.h>
 //#include <kpluginloader.h>
diff --git a/kcms/keyboard/kcm_keyboard_widget.cpp b/kcms/keyboard/kcm_keyboard_widget.cpp
index c02853d..0f55173 100644
--- a/kcms/keyboard/kcm_keyboard_widget.cpp
+++ b/kcms/keyboard/kcm_keyboard_widget.cpp
@@ -48,7 +48,6 @@
 
 #include "ui_kcm_add_layout_dialog.h"
 
-Q_LOGGING_CATEGORY(KEBOARD_WIDGET, "keyboard.widget")
 
 static const QString GROUP_SWITCH_GROUP_NAME("grp");
 static const QString LV3_SWITCH_GROUP_NAME("lv3");
@@ -617,7 +616,7 @@ void KCMKeyboardWidget::updateXkbShortcutButton(const QString& groupName, QPushB
 		const OptionGroupInfo* optionGroupInfo = rules->getOptionGroupInfo(groupName);
 		const OptionInfo* optionInfo = optionGroupInfo->getOptionInfo(option);
 		if( optionInfo == NULL || optionInfo->description == NULL ) {
-            qCDebug(KEBOARD_WIDGET) << "Could not find option info for " << option;
+        		qCDebug(KCM_KEYBOARD) << "Could not find option info for " << option;
 			button->setText(grpOptions.first());
 		}
 		else {
diff --git a/kcms/keyboard/kcm_keyboard_widget.h b/kcms/keyboard/kcm_keyboard_widget.h
index ac3aa16..04d9e3a 100644
--- a/kcms/keyboard/kcm_keyboard_widget.h
+++ b/kcms/keyboard/kcm_keyboard_widget.h
@@ -23,11 +23,14 @@
 #include "ui_kcm_keyboard.h"
 
 #include <kcomponentdata.h>
+
 #include <QTabWidget>
 #include <QLoggingCategory>
 
+
 Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
 
+
 class QWidget;
 class KeyboardConfig;
 class Rules;
diff --git a/kcms/keyboard/keyboard_config.cpp b/kcms/keyboard/keyboard_config.cpp
index 61a78c9..1d2ee3e 100644
--- a/kcms/keyboard/keyboard_config.cpp
+++ b/kcms/keyboard/keyboard_config.cpp
@@ -20,7 +20,6 @@
 
 #include <ksharedconfig.h>
 #include <kconfiggroup.h>
-#include <kdebug.h>
 
 
 static const char* const SWITCHING_POLICIES[] = {"Global", "Desktop", "WinClass", "Window", NULL };
@@ -143,7 +142,7 @@ void KeyboardConfig::load()
 //    	}
 //    }
 
-	kDebug() << "configuring layouts" << configureLayouts << "configuring options" << resetOldXkbOptions;
+	qCDebug(KCM_KEYBOARD) << "configuring layouts" << configureLayouts << "configuring options" << \
resetOldXkbOptions;  }
 
 void KeyboardConfig::save()
diff --git a/kcms/keyboard/keyboard_config.h b/kcms/keyboard/keyboard_config.h
index b86418d..aff49a7 100644
--- a/kcms/keyboard/keyboard_config.h
+++ b/kcms/keyboard/keyboard_config.h
@@ -27,6 +27,10 @@
 #include <QtCore/QList>
 #include <QtCore/QMap>
 #include <QtCore/QPair>
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
 
 /**
  * This class provides configuration options for keyboard module
diff --git a/kcms/keyboard/keyboard_daemon.cpp b/kcms/keyboard/keyboard_daemon.cpp
index 0c79ee5..1438dd7 100644
--- a/kcms/keyboard/keyboard_daemon.cpp
+++ b/kcms/keyboard/keyboard_daemon.cpp
@@ -22,7 +22,6 @@
 #include <QtDBus/QtDBus>
 #include <QProcess>
 
-#include <kdebug.h>
 #include <kpluginfactory.h>
 #include <kaction.h>
 #include <kactioncollection.h>
@@ -91,7 +90,7 @@ KeyboardDaemon::~KeyboardDaemon()
 
 void KeyboardDaemon::configureKeyboard()
 {
-	kDebug() << "Configuring keyboard";
+	qCDebug(KCM_KEYBOARD) << "Configuring keyboard";
 	init_keyboard_hardware();
 
 	keyboardConfig.load();
@@ -213,7 +212,7 @@ void KeyboardDaemon::layoutMapChanged()
 
 void KeyboardDaemon::switchToNextLayout()
 {
-	kDebug() << "Toggling layout";
+	qCDebug(KCM_KEYBOARD) << "Toggling layout";
 	X11Helper::switchToNextLayout();
 
         LayoutUnit newLayout = X11Helper::getCurrentLayout();
diff --git a/kcms/keyboard/keyboard_daemon.h b/kcms/keyboard/keyboard_daemon.h
index 4edb968..760c86c 100644
--- a/kcms/keyboard/keyboard_daemon.h
+++ b/kcms/keyboard/keyboard_daemon.h
@@ -29,6 +29,9 @@
 #include "bindings.h"
 
 
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
+
 class KActionCollection;
 class XInputEventNotifier;
 class LayoutTrayIcon;
diff --git a/kcms/keyboard/keyboard_hardware.cpp b/kcms/keyboard/keyboard_hardware.cpp
index df5f417..aa86f69 100644
--- a/kcms/keyboard/keyboard_hardware.cpp
+++ b/kcms/keyboard/keyboard_hardware.cpp
@@ -16,12 +16,12 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 #include <kconfiggroup.h>
 #include <ksharedconfig.h>
 
 #include <QX11Info>
 #include <QCursor>	// WTF? - otherwise compiler complains
+#include <QDebug>
 
 #include <math.h>
 
@@ -42,7 +42,7 @@ static
 void set_repeatrate(int delay, double rate)
 {
 	if( !X11Helper::xkbSupported(NULL) ) {
-		kError() << "Failed to set keyboard repeat rate: xkb is not supported";
+		qCritical() << "Failed to set keyboard repeat rate: xkb is not supported";
 		return;
 	}
 
diff --git a/kcms/keyboard/layout_memory.cpp b/kcms/keyboard/layout_memory.cpp
index 9e72361..cf894a6 100644
--- a/kcms/keyboard/layout_memory.cpp
+++ b/kcms/keyboard/layout_memory.cpp
@@ -21,7 +21,6 @@
 #include <QSet>
 #include <QX11Info>
 
-#include <kdebug.h>
 #include <kwindowsystem.h>
 
 #include "x11_helper.h"
@@ -72,7 +71,7 @@ QString LayoutMemory::getCurrentMapKey() {
 		WId wid = KWindowSystem::self()->activeWindow();
 		KWindowInfo winInfo(wid, NET::WMWindowType);
 		NET::WindowType windowType = winInfo.windowType( NET::NormalMask | NET::DesktopMask | NET::DialogMask \
                );
-		kDebug() << "window type" << windowType;
+		qCDebug(KCM_KEYBOARD, ) << "window type" << windowType;
 
 		// we ignore desktop type so that our keybaord layout applet on desktop could change layout properly
 		if( windowType == NET::Desktop )
@@ -86,7 +85,7 @@ QString LayoutMemory::getCurrentMapKey() {
 		WId wid = KWindowSystem::self()->activeWindow();
 		KWindowInfo winInfo(wid, NET::WMWindowType, NET::WM2WindowClass);
 		NET::WindowType windowType = winInfo.windowType( NET::NormalMask | NET::DesktopMask | NET::DialogMask \
                );
-		kDebug() << "window type" << windowType;
+		qCDebug(KCM_KEYBOARD, ) << "window type" << windowType;
 
 		// we ignore desktop type so that our keybaord layout applet on desktop could change layout properly
 		if( windowType == NET::Desktop )
@@ -96,7 +95,7 @@ QString LayoutMemory::getCurrentMapKey() {
 
 		// shall we use pid or window class ??? - class seems better (see e.g. \
https://bugs.kde.org/show_bug.cgi?id=245507)  // for window class shall we use class.class or class.name? \
                (seem class.class is a bit better - more app-oriented)
-		kDebug() << "New active window with class.class: " << winInfo.windowClassClass();
+		qCDebug(KCM_KEYBOARD, ) << "New active window with class.class: " << winInfo.windowClassClass();
 		return QString(winInfo.windowClassClass());
 //		NETWinInfo winInfoForPid( QX11Info::display(), wid, QX11Info::appRootWindow(), NET::WMPid);
 //		return QString::number(winInfoForPid.pid());
@@ -127,20 +126,20 @@ void LayoutMemory::layoutMapChanged()
 	if( prevLayoutList == newLayoutList )
 		return;
 
-	kDebug() << "Layout map change: " << LayoutSet::toString(prevLayoutList) << "-->" << \
LayoutSet::toString(newLayoutList); +	qCDebug(KCM_KEYBOARD, ) << "Layout map change: " << \
LayoutSet::toString(prevLayoutList) << "-->" << LayoutSet::toString(newLayoutList);  prevLayoutList = \
newLayoutList;  
 	//TODO: need more thinking here on how to support external map resetting
 	if( keyboardConfig.configureLayouts
 			&& keyboardConfig.isSpareLayoutsEnabled()
 			&& isExtraSubset(keyboardConfig.layouts, newLayoutList) ) {
-		kDebug() << "Layout map change for extra layout";
+		qCDebug(KCM_KEYBOARD, ) << "Layout map change for extra layout";
 		layoutChanged();	// to remember new map for active "window"
 	}
 	else {
 //		if( newLayoutList != keyboardConfig.getDefaultLayouts() ) {
 			//		layoutList = newLayoutList;
-			kDebug() << "Layout map change from external source: clearing layout memory";
+			qCDebug(KCM_KEYBOARD, ) << "Layout map change from external source: clearing layout memory";
 			layoutMap.clear();
 //		}
 	}
@@ -162,10 +161,10 @@ void LayoutMemory::setCurrentLayoutFromMap()
 		return;
 
 	if( ! layoutMap.contains(layoutMapKey) ) {
-//		kDebug() << "new key for layout map" << layoutMapKey;
+//		qCDebug(KCM_KEYBOARD, ) << "new key for layout map" << layoutMapKey;
 
 		if( ! X11Helper::isDefaultLayout() ) {
-//			kDebug() << "setting default layout for container key" << layoutMapKey;
+//			qCDebug(KCM_KEYBOARD, ) << "setting default layout for container key" << layoutMapKey;
 			if( keyboardConfig.configureLayouts && keyboardConfig.isSpareLayoutsEnabled()
 					&& X11Helper::getLayoutsList() != keyboardConfig.getDefaultLayouts() ) {
 				XkbHelper::initializeKeyboardLayouts(keyboardConfig.getDefaultLayouts());
@@ -175,7 +174,7 @@ void LayoutMemory::setCurrentLayoutFromMap()
 	}
 	else {
 		LayoutSet layoutFromMap = layoutMap[layoutMapKey];
-		kDebug() << "Setting layout map item" << layoutFromMap.currentLayout.toString()
+		qCDebug(KCM_KEYBOARD, ) << "Setting layout map item" << layoutFromMap.currentLayout.toString()
 				<< "for container key" << layoutMapKey;
 
 		LayoutSet currentLayouts = X11Helper::getCurrentLayouts();
@@ -200,7 +199,7 @@ void LayoutMemory::windowChanged(WId /*wId*/)
 {
 //	KPluginInfo::List plugins = Plasma::Containment::listContainments();
 //	foreach(KPluginInfo info, plugins) {
-//		kDebug() << "applets" << info.name();
+//		qCDebug(KCM_KEYBOARD, ) << "applets" << info.name();
 //	}
 	setCurrentLayoutFromMap();
 }
diff --git a/kcms/keyboard/layout_memory.h b/kcms/keyboard/layout_memory.h
index df8568c..5affe7a 100644
--- a/kcms/keyboard/layout_memory.h
+++ b/kcms/keyboard/layout_memory.h
@@ -23,10 +23,15 @@
 #include <QtCore/QString>
 #include <QtCore/QMap>
 #include <QtGui/QWidgetList> //For WId
+#include <QLoggingCategory>
 
 #include "x11_helper.h"
 #include "keyboard_config.h"
 
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
+
 class LayoutMemoryPersister;
 
 class LayoutMemory : public QObject
diff --git a/kcms/keyboard/layout_memory_persister.cpp b/kcms/keyboard/layout_memory_persister.cpp
index ef3fc88..e4fc391 100644
--- a/kcms/keyboard/layout_memory_persister.cpp
+++ b/kcms/keyboard/layout_memory_persister.cpp
@@ -18,12 +18,12 @@
 
 #include "layout_memory_persister.h"
 
-#include <kdebug.h>
 #include <kconfiggroup.h>
 #include <ksharedconfig.h>
 #include <kstandarddirs.h>
 
-#include <QtCore/QFile>
+#include <QFile>
+#include <QStandardPaths>
 #include <QtXml/qdom.h>
 #include <QtXml/qxml.h>
 
@@ -88,7 +88,7 @@ QString LayoutMemoryPersister::getLayoutMapAsString()
 static bool isRestoreSession()
 {
     KConfigGroup c(KSharedConfig::openConfig("ksmserverrc", KConfig::NoGlobals), "General");
-    kDebug() << "loginMode:" << c.readEntry("loginMode");
+    qCDebug(KCM_KEYBOARD) << "loginMode:" << c.readEntry("loginMode");
     QString loginMode = c.readEntry("loginMode");
     return loginMode != "default" && loginMode != "restoreSavedSession";	// we don't know how to restore \
saved session - only previous one  }
@@ -97,7 +97,8 @@ bool LayoutMemoryPersister::save(const QString& moduleName)
 {
 	if( isRestoreSession() ) {
     	QString relPath = moduleName + REL_SESSION_FILE_PATH;
-    	QFile file(KStandardDirs::locateLocal("data", relPath));
+        QFile file(KStandardDirs::locateLocal("data", relPath));
+//    	QFile file(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + '/' + relPath);
     	return saveToFile(file);
     }
     return false;
@@ -107,7 +108,8 @@ bool LayoutMemoryPersister::restore(const QString& moduleName)
 {
 	if( isRestoreSession() ) {
     	QString relPath = moduleName + REL_SESSION_FILE_PATH;
-    	QFile file(KStandardDirs::locateLocal("data", relPath));
+        QFile file(KStandardDirs::locateLocal("data", relPath));
+//    	QFile file(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + '/' + relPath);
     	return restoreFromFile(file);
     }
     return false;
@@ -122,7 +124,7 @@ bool LayoutMemoryPersister::saveToFile(const QFile& file_)
 
 	QFile file(file_.fileName());	// so we don't expose the file we open/close to the caller
     if( ! file.open( QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text) ) {
-    	kWarning() << "Failed to open layout memory xml file for writing" << file.fileName();
+    	qWarning() << "Failed to open layout memory xml file for writing" << file.fileName();
     	return false;
     }
 
@@ -131,13 +133,13 @@ bool LayoutMemoryPersister::saveToFile(const QFile& file_)
     out.flush();
 
     if( file.error() != QFile::NoError ) {
-    	kWarning() << "Failed to store keyboard layout memory, error" << file.error();
+    	qWarning() << "Failed to store keyboard layout memory, error" << file.error();
         file.close();
     	file.remove();
     	return false;
     }
     else {
-    	kDebug() << "Keyboard layout memory stored into" << file.fileName() << "written" << file.pos();
+    	qCDebug(KCM_KEYBOARD) << "Keyboard layout memory stored into" << file.fileName() << "written" << \
file.pos();  return true;
     }
 }
@@ -214,7 +216,7 @@ bool LayoutMemoryPersister::restoreFromFile(const QFile& file_)
 
 	QFile file(file_.fileName());	// so we don't expose the file we open/close to the caller
     if( ! file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
-    	kWarning() << "Failed to open layout memory xml file for reading" << file.fileName() << "error:" << \
file.error(); +    	qWarning() << "Failed to open layout memory xml file for reading" << file.fileName() \
<< "error:" << file.error();  return false;
     }
 
@@ -225,17 +227,17 @@ bool LayoutMemoryPersister::restoreFromFile(const QFile& file_)
 	reader.setErrorHandler(&mapHandler);
 
 	QXmlInputSource xmlInputSource(&file);
-	kDebug() << "Restoring keyboard layout map from" << file.fileName();
+	qCDebug(KCM_KEYBOARD) << "Restoring keyboard layout map from" << file.fileName();
 
 	if( ! reader.parse(xmlInputSource) ) {
-		kWarning() << "Failed to parse the layout memory file" << file.fileName();
+		qWarning() << "Failed to parse the layout memory file" << file.fileName();
 		return false;
 	}
 
 	if( layoutMemory.keyboardConfig.switchingPolicy == KeyboardConfig::SWITCH_POLICY_GLOBAL ) {
 		if( mapHandler.globalLayout.isValid() && \
layoutMemory.keyboardConfig.layouts.contains(mapHandler.globalLayout)) {  globalLayout = \
                mapHandler.globalLayout;
-			kDebug() << "Restored global layout" << globalLayout.toString();
+			qCDebug(KCM_KEYBOARD) << "Restored global layout" << globalLayout.toString();
 		}
 	}
 	else {
@@ -245,7 +247,7 @@ bool LayoutMemoryPersister::restoreFromFile(const QFile& file_)
 				layoutMemory.layoutMap.insert(key, mapHandler.layoutMap[key]);
 			}
 		}
-		kDebug() << "Restored layouts for" << layoutMemory.layoutMap.size() << "containers";
+		qCDebug(KCM_KEYBOARD) << "Restored layouts for" << layoutMemory.layoutMap.size() << "containers";
 	}
 	return true;
 }
@@ -254,7 +256,7 @@ bool LayoutMemoryPersister::canPersist() {
 	// we can't persist per window - as we're using window id which is not preserved between sessions
 	bool windowMode = layoutMemory.keyboardConfig.switchingPolicy == KeyboardConfig::SWITCH_POLICY_WINDOW;
 	if( windowMode ) {
-		kDebug() << "Not saving session for window mode";
+		qCDebug(KCM_KEYBOARD) << "Not saving session for window mode";
 	}
 	return !windowMode;
 }
diff --git a/kcms/keyboard/layout_memory_persister.h b/kcms/keyboard/layout_memory_persister.h
index 8c4b3c5..8bbb93a 100644
--- a/kcms/keyboard/layout_memory_persister.h
+++ b/kcms/keyboard/layout_memory_persister.h
@@ -19,10 +19,14 @@
 #ifndef LAYOUT_MEMORY_PERSISTER_H_
 #define LAYOUT_MEMORY_PERSISTER_H_
 
-#include <QtCore/QString>
+#include <QString>
+#include <QLoggingCategory>
 
 #include "x11_helper.h"
 
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
 class LayoutMemory;
 class QFile;
 
diff --git a/kcms/keyboard/layout_tray_icon.cpp b/kcms/keyboard/layout_tray_icon.cpp
index b94af34..41a4765 100644
--- a/kcms/keyboard/layout_tray_icon.cpp
+++ b/kcms/keyboard/layout_tray_icon.cpp
@@ -18,7 +18,6 @@
 
 #include "layout_tray_icon.h"
 
-//#include <kdebug.h>
 #include <kstatusnotifieritem.h>
 #include <klocalizedstring.h>
 
diff --git a/kcms/keyboard/layout_widget.cpp b/kcms/keyboard/layout_widget.cpp
index e67b2d7..effacf9 100644
--- a/kcms/keyboard/layout_widget.cpp
+++ b/kcms/keyboard/layout_widget.cpp
@@ -18,7 +18,6 @@
 
 #include "layout_widget.h"
 
-//#include <kdebug.h>
 #include <kpluginfactory.h>
 
 #include <QPushButton>
diff --git a/kcms/keyboard/layouts_menu.cpp b/kcms/keyboard/layouts_menu.cpp
index fd436c4..82c3e2c 100644
--- a/kcms/keyboard/layouts_menu.cpp
+++ b/kcms/keyboard/layouts_menu.cpp
@@ -21,7 +21,6 @@
 #include <kmenu.h>
 #include <ktoolinvocation.h>
 #include <klocalizedstring.h>
-#include <kdebug.h>
 
 #include <QAction>
 #include <QMenu>
@@ -81,7 +80,7 @@ int LayoutsMenu::switchToLayout(const LayoutUnit& layoutUnit, const KeyboardConf
 		res = X11Helper::setLayout(layoutUnit);
 	}
 	else {
-		kWarning() << "switchToLayout with unknown layout" << layoutUnit.toString();
+		qWarning() << "switchToLayout with unknown layout" << layoutUnit.toString();
 		res = -1;
 	}
 	return res;
diff --git a/kcms/keyboard/preview/geometry_components.cpp \
b/kcms/keyboard/preview/geometry_components.cpp index 7addcb5..997911e 100644
--- a/kcms/keyboard/preview/geometry_components.cpp
+++ b/kcms/keyboard/preview/geometry_components.cpp
@@ -24,6 +24,9 @@
 #include <QPoint>
 
 
+Q_LOGGING_CATEGORY(KEYBOARD_PREVIEW, "keyboard_preview")
+
+
 GShape::GShape()
 {
     cordi_count = 0;
@@ -53,11 +56,11 @@ QPoint GShape :: getCordii(int i) const
 
 void GShape::display()
 {
-    qDebug() << "shape: " << sname << "\n";
-    qDebug() << "(" << approx.x() << "," << approx.y() << ");";
+    qCDebug(KEYBOARD_PREVIEW) << "shape: " << sname << "\n";
+    qCDebug(KEYBOARD_PREVIEW) << "(" << approx.x() << "," << approx.y() << ");";
 
     for (int i = 0; i < cordi_count; i++) {
-        qDebug() << cordii[i];
+        qCDebug(KEYBOARD_PREVIEW) << cordii[i];
     }
 }
 
@@ -107,8 +110,8 @@ void Key::setKeyPosition(double x, double y)
 
 void Key::showKey()
 {
-    qDebug() << "\n\tKey: " << name << "\tshape: " << shapeName << "\toffset: " << offset;
-    qDebug() << "\tposition" << position;
+    qCDebug(KEYBOARD_PREVIEW) << "\n\tKey: " << name << "\tshape: " << shapeName << "\toffset: " << \
offset; +    qCDebug(KEYBOARD_PREVIEW) << "\tposition" << position;
 }
 
 
@@ -123,15 +126,15 @@ Row::Row()
 
 void Row::addKey()
 {
-    //qDebug() << "keyCount: " << keyCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "keyCount: " << keyCount;
     keyCount++;
     keyList << Key();
 }
 
 void Row::displayRow()
 {
-    qDebug() << "\nRow: (" << left << "," << top << ")\n";
-    qDebug() << "vertical: " << vertical;
+    qCDebug(KEYBOARD_PREVIEW) << "\nRow: (" << left << "," << top << ")\n";
+    qCDebug(KEYBOARD_PREVIEW) << "vertical: " << vertical;
     for (int i = 0; i < keyCount; i++) {
         keyList[i].showKey();
     }
@@ -150,17 +153,17 @@ Section::Section()
 
 void Section::addRow()
 {
-    //qDebug() << "\nrowCount: " << rowCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nrowCount: " << rowCount;
     rowCount++;
     rowList << Row();
 }
 
 void Section::displaySection()
 {
-    //qDebug() << "\nSection: " << name << "\n\tposition: (" << left << "," << top << ");" << angle << \
                "\n";
-    //qDebug() << "vertical: " << vertical;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nSection: " << name << "\n\tposition: (" << left << "," << top << \
");" << angle << "\n"; +    //qCDebug(KEYBOARD_PREVIEW) << "vertical: " << vertical;
     for (int i = 0; i < rowCount; i++) {
-        qDebug() << "\n\t";
+        qCDebug(KEYBOARD_PREVIEW) << "\n\t";
         rowList[i].displayRow();
     }
 }
@@ -207,11 +210,11 @@ void Geometry::addShape()
 
 void Geometry::display()
 {
-    qDebug() << name << "\n" << description << "\nwidth:" << width
+    qCDebug(KEYBOARD_PREVIEW) << name << "\n" << description << "\nwidth:" << width
              << "\nheight:" << height << "\n" << "sectionTop:" << sectionTop;
-    qDebug() << "\nsectionLeft:" << sectionLeft << "\nrowTop:" << rowTop << "\nrowLeft:"
+    qCDebug(KEYBOARD_PREVIEW) << "\nsectionLeft:" << sectionLeft << "\nrowTop:" << rowTop << \
                "\nrowLeft:"
              << rowLeft << "\nkeyGap: " << keyGap << "\nkeyShape:" << keyShape << "\n";
-    qDebug() << "vertical:" << vertical;
+    qCDebug(KEYBOARD_PREVIEW) << "vertical:" << vertical;
 
     for (int i = 0; i < shape_count; i++) {
         shapes[i].display();
@@ -224,7 +227,7 @@ void Geometry::display()
 
 void Geometry::addSection()
 {
-    //qDebug() << "\nsectionCount: " << sectionCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsectionCount: " << sectionCount;
     sectionCount++;
     sectionList << Section();
 }
diff --git a/kcms/keyboard/preview/geometry_components.h b/kcms/keyboard/preview/geometry_components.h
index 65d3d67..e66fd44 100644
--- a/kcms/keyboard/preview/geometry_components.h
+++ b/kcms/keyboard/preview/geometry_components.h
@@ -22,6 +22,10 @@
 #include <QString>
 #include <QPoint>
 #include <QList>
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KEYBOARD_PREVIEW)
 
 
 class GShape
diff --git a/kcms/keyboard/preview/geometry_parser.cpp b/kcms/keyboard/preview/geometry_parser.cpp
index 0b8ed92..a16ed49 100644
--- a/kcms/keyboard/preview/geometry_parser.cpp
+++ b/kcms/keyboard/preview/geometry_parser.cpp
@@ -334,7 +334,7 @@ void Geometry_parser<Iterator>::setRowLeft(double a)
 template<typename Iterator>
 void Geometry_parser<Iterator>::setSectionTop(double a)
 {
-    //qDebug() << "\nsectionCount" << geom.sectionCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsectionCount" << geom.sectionCount;
     int secn = geom.getSectionCount();
     geom.sectionList[secn].setTop(a + geom.sectionTop);
     keyCordiY = geom.sectionList[secn].getTop();
@@ -344,7 +344,7 @@ void Geometry_parser<Iterator>::setSectionTop(double a)
 template<typename Iterator>
 void Geometry_parser<Iterator>::setSectionLeft(double a)
 {
-    //qDebug() << "\nsectionCount" << geom.sectionCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsectionCount" << geom.sectionCount;
     int secn = geom.getSectionCount();
     geom.sectionList[secn].setLeft(a + geom.sectionLeft);
     keyCordiX = geom.sectionList[secn].getLeft();
@@ -355,7 +355,7 @@ void Geometry_parser<Iterator>::setSectionLeft(double a)
 template<typename Iterator>
 void Geometry_parser<Iterator>::setSectionAngle(double a)
 {
-    //qDebug() << "\nsectionCount" << geom.sectionCount;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsectionCount" << geom.sectionCount;
     int secn = geom.getSectionCount();
     geom.sectionList[secn].setAngle(a);
 }
@@ -391,7 +391,7 @@ void Geometry_parser<Iterator>::setKeyName(std::string n)
     int secn = geom.getSectionCount();
     int rown = geom.sectionList[secn].getRowCount();
     int keyn = geom.sectionList[secn].rowList[rown].getKeyCount();
-    //qDebug() << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
     geom.sectionList[secn].rowList[rown].keyList[keyn].setKeyName(QString::fromUtf8(n.data(), \
n.size()));  }
 
@@ -402,7 +402,7 @@ void Geometry_parser<Iterator>::setKeyShape(std::string n)
     int secn = geom.getSectionCount();
     int rown = geom.sectionList[secn].getRowCount();
     int keyn = geom.sectionList[secn].rowList[rown].getKeyCount();
-    //qDebug() << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
     geom.sectionList[secn].rowList[rown].keyList[keyn].setShapeName(QString::fromUtf8(n.data(), \
n.size()));  }
 
@@ -420,11 +420,11 @@ void Geometry_parser<Iterator>::setKeyNameandShape(std::string n)
 template<typename Iterator>
 void Geometry_parser<Iterator>::setKeyOffset()
 {
-    //qDebug() << "\nhere\n";
+    //qCDebug(KEYBOARD_PREVIEW) << "\nhere\n";
     int secn = geom.getSectionCount();
     int rown = geom.sectionList[secn].getRowCount();
     int keyn = geom.sectionList[secn].rowList[rown].getKeyCount();
-    //qDebug() << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
+    //qCDebug(KEYBOARD_PREVIEW) << "\nsC: " << secn << "\trC: " << rown << "\tkn: " << keyn;
     geom.sectionList[secn].rowList[rown].keyList[keyn].setOffset(KeyOffset);
 }
 
@@ -478,7 +478,7 @@ Geometry parseGeometry(const QString &model)
     QString geometryFile = geoId.fileName;
     QString geometryName = geoId.geoName;
 
-    qDebug() << "looking for model" << model << "geometryName" << geometryName << "in" << geometryFile;
+    qCDebug(KEYBOARD_PREVIEW) << "looking for model" << model << "geometryName" << geometryName << "in" \
<< geometryFile;  
     QString xkbParentDir = findGeometryBaseDir();
     geometryFile.prepend(xkbParentDir);
@@ -508,7 +508,7 @@ Geometry parseGeometry(const QString &model)
         bool success = phrase_parse(iter, end, geomertyParser, space);
 
         if (success && iter == end) {
-//                qDebug() << "Geometry parsing succeeded for" << input.left(20);
+//                qCDebug(KEYBOARD_PREVIEW) << "Geometry parsing succeeded for" << input.left(20);
             geomertyParser.geom.setParsing(true);
         } else {
             qCritical() << "Geometry parsing failed for\n\t" << input.left(30);
diff --git a/kcms/keyboard/preview/kbpreviewframe.cpp b/kcms/keyboard/preview/kbpreviewframe.cpp
index d378449..07d7d24 100644
--- a/kcms/keyboard/preview/kbpreviewframe.cpp
+++ b/kcms/keyboard/preview/kbpreviewframe.cpp
@@ -37,7 +37,6 @@
 #include <KLocale>
 
 
-
 static const QColor keyBorderColor("#d4d4d4");
 static const QColor lev12color(Qt::black);
 static const QColor lev34color("#0033FF");
@@ -210,28 +209,28 @@ void KbPreviewFrame::drawShape(QPainter &painter, const GShape& s, int x, int y,
         refX = geometry.sectionList[i].getLeft();
         refY = geometry.sectionList[i].getTop();
 
-        //qDebug() <<"\ntransform";
+        //qCDebug(KEYBOARD_PREVIEW) <<"\ntransform";
         for(int j=0; j<size; j++){
             double x = temp[j].x()-refX;
             double y = temp[j].y()-refY;
 
-            //qDebug() <<"(" <<x <<"," <<y <<")->";
+            //qCDebug(KEYBOARD_PREVIEW) <<"(" <<x <<"," <<y <<")->";
 
             float theta = ( 3.1459 * geometry.sectionList[i].getAngle() )/180;
             double x_ = x*cos(theta) - y*sin(theta);
 
-            //qDebug() <<"x_= " <<x <<"*" <<cos(theta) <<"-" <<y <<"*" <<sin(theta);
+            //qCDebug(KEYBOARD_PREVIEW) <<"x_= " <<x <<"*" <<cos(theta) <<"-" <<y <<"*" <<sin(theta);
 
             double y_ = x*sin(theta) + y*cos(theta);
 
-            //qDebug() <<"\ny_= " <<x <<"*" <<sin(theta) <<"+" <<y <<"*" <<cos(theta);
-            //qDebug() <<"(" <<x_ <<"," <<y_ <<")\n";
+            //qCDebug(KEYBOARD_PREVIEW) <<"\ny_= " <<x <<"*" <<sin(theta) <<"+" <<y <<"*" <<cos(theta);
+            //qCDebug(KEYBOARD_PREVIEW) <<"(" <<x_ <<"," <<y_ <<")\n";
 
             temp[j]=QPoint(scaleFactor*(x_+refX), scaleFactor*(y_+refY));
         }
 
         /*for(int i=0;i<size;i++){
-            qDebug() <<temp[i];
+            qCDebug(KEYBOARD_PREVIEW) <<temp[i];
         }*/
 
         painter.drawPolygon(temp, size);
@@ -341,10 +340,10 @@ void KbPreviewFrame::generateKeyboardLayout(const QString& layout, const QString
     while (scaleFactor*endx + screenWidth/20 > screenWidth) {
         scaleFactor -= 0.2;
     }
-    qDebug() << "scale factor: 2.5 ->" << scaleFactor;
+    qCDebug(KEYBOARD_PREVIEW) << "scale factor: 2.5 ->" << scaleFactor;
 
     setFixedSize(scaleFactor*endx+60, scaleFactor*endy+60);
-    qDebug() << screenWidth << ":" << scaleFactor << scaleFactor*endx+60 << scaleFactor*endy+60;
+    qCDebug(KEYBOARD_PREVIEW) << screenWidth << ":" << scaleFactor << scaleFactor*endx+60 << \
scaleFactor*endy+60;  keyboardLayout = grammar::parseSymbols(layout, layoutVariant);
 }
 
diff --git a/kcms/keyboard/preview/kbpreviewframe.h b/kcms/keyboard/preview/kbpreviewframe.h
index 48a72a8..510f5c7 100644
--- a/kcms/keyboard/preview/kbpreviewframe.h
+++ b/kcms/keyboard/preview/kbpreviewframe.h
@@ -27,6 +27,11 @@
 #include <QFrame>
 #include <QHash>
 #include <QToolTip>
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KEYBOARD_PREVIEW)
+
 
 class Geometry;
 class GShape;
diff --git a/kcms/keyboard/preview/keyboardlayout.cpp b/kcms/keyboard/preview/keyboardlayout.cpp
index d949003..86e3b83 100644
--- a/kcms/keyboard/preview/keyboardlayout.cpp
+++ b/kcms/keyboard/preview/keyboardlayout.cpp
@@ -53,9 +53,9 @@ QString KbKey::getSymbol(int i){
 
 
 void KbKey::display(){
-    qDebug() << keyName << " : ";
+    qCDebug(KEYBOARD_PREVIEW) << keyName << " : ";
     for(int i=0; i<symbolCount; i++)
-        qDebug() << "\t" << symbols[i];
+        qCDebug(KEYBOARD_PREVIEW) << "\t" << symbols[i];
 }
 
 
@@ -108,9 +108,9 @@ int KbLayout :: findKey(QString n){
 
 
 void KbLayout::display(){
-//    qDebug() << name << "\n";
+//    qCDebug(KEYBOARD_PREVIEW) << name << "\n";
 //    for(int i = 0; i<includeCount; i++){
-//        qDebug() << include[i];
+//        qCDebug(KEYBOARD_PREVIEW) << include[i];
 //    }
     for(int i = 0 ; i < keyCount; i++ ){
         keyList[i].display();
diff --git a/kcms/keyboard/preview/keyboardlayout.h b/kcms/keyboard/preview/keyboardlayout.h
index 12b56b0..c20e7d3 100644
--- a/kcms/keyboard/preview/keyboardlayout.h
+++ b/kcms/keyboard/preview/keyboardlayout.h
@@ -20,9 +20,14 @@
 #define KEYBOARDLAYOUT_NEW_H
 
 #include "keyaliases.h"
+
 #include <QString>
 #include <QStringList>
 #include <QList>
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KEYBOARD_PREVIEW)
 
 
 class KbKey{
diff --git a/kcms/keyboard/preview/keysymhelper.cpp b/kcms/keyboard/preview/keysymhelper.cpp
index b84b9d1..a5773f2 100644
--- a/kcms/keyboard/preview/keysymhelper.cpp
+++ b/kcms/keyboard/preview/keysymhelper.cpp
@@ -55,12 +55,12 @@ QString KeySymHelper::getKeySymbol(const QString& opton)
 
 //    if( ucs == -1 && (keysym >= 0xFE50 && keysym <= 0xFE5F) ) {
 //        ucs = 0x0300 + (keysym & 0x000F);
-//        kWarning() << "Got dead symbol" << QString("0x%1").arg(keysym, 0, 16) << "named" << opton << \
"will use" << QString("0x%1").arg(ucs, 0, 16) << "as UCS"; +//        qWarning() << "Got dead symbol" << \
QString("0x%1").arg(keysym, 0, 16) << "named" << opton << "will use" << QString("0x%1").arg(ucs, 0, 16) \
<< "as UCS";  //    }
 
     if( ucs == -1 ) {
         nill++;
-        kWarning() << "No mapping from keysym:" << QString("0x%1").arg(keysym, 0, 16) << "named:" << \
opton << "to UCS"; +        qWarning() << "No mapping from keysym:" << QString("0x%1").arg(keysym, 0, 16) \
<< "named:" << opton << "to UCS";  }
     
     QString ucsStr = QString(QChar((int)ucs));
@@ -70,7 +70,7 @@ QString KeySymHelper::getKeySymbol(const QString& opton)
         ucsStr = " " + ucsStr + " ";
     }
 
-//    kWarning() << "--" << opton << "keysym: " << keysym << QString("0x%1").arg(keysym, 0, 16) << \
"keysym2string" << XKeysymToString(keysym) +//    qWarning() << "--" << opton << "keysym: " << keysym << \
QString("0x%1").arg(keysym, 0, 16) << "keysym2string" << XKeysymToString(keysym)  //         << "---" << \
QString("0x%1").arg(ucs, 0, 16) << ucsStr;  
     keySymbolMap[opton] = ucsStr;
diff --git a/kcms/keyboard/preview/symbol_parser.cpp b/kcms/keyboard/preview/symbol_parser.cpp
index 0e9f033..13bf1e1 100644
--- a/kcms/keyboard/preview/symbol_parser.cpp
+++ b/kcms/keyboard/preview/symbol_parser.cpp
@@ -99,8 +99,8 @@ void Symbol_parser<Iterator>::getSymbol(std::string n)
     int index = layout.keyList[keyIndex].getSymbolCount();
     layout.keyList[keyIndex].addSymbol(QString::fromUtf8(n.data(), n.size()),
                                        index);
-    //qDebug() << "adding symbol: " << QString::fromUtf8(n.data(), n.size());
-    //qDebug() << "added symbol: " << layout.keyList[keyIndex].getSymbol(index) << " in " << keyIndex << \
" at " << index; +    //qCDebug(KEYBOARD_PREVIEW) << "adding symbol: " << QString::fromUtf8(n.data(), \
n.size()); +    //qCDebug(KEYBOARD_PREVIEW) << "added symbol: " << \
layout.keyList[keyIndex].getSymbol(index) << " in " << keyIndex << " at " << index;  }
 
 template<typename Iterator>
@@ -111,13 +111,13 @@ void Symbol_parser<Iterator>::addKeyName(std::string n)
         kname = alias.getAlias(layout.country, kname);
     }
     keyIndex = layout.findKey(kname);
-    //qDebug() << layout.getKeyCount();
+    //qCDebug(KEYBOARD_PREVIEW) << layout.getKeyCount();
     if (keyIndex == -1) {
         layout.keyList[layout.getKeyCount()].keyName = kname;
         keyIndex = layout.getKeyCount();
         newKey = 1;
     }
-    // qDebug() << "key at" << keyIndex;
+    // qCDebug(KEYBOARD_PREVIEW) << "key at" << keyIndex;
 }
 
 template<typename Iterator>
@@ -126,7 +126,7 @@ void Symbol_parser<Iterator>::addKey()
     if (newKey == 1) {
         layout.addKey();
         newKey = 0;
-        //qDebug() << "new key";
+        //qCDebug(KEYBOARD_PREVIEW) << "new key";
     }
 }
 
@@ -140,7 +140,7 @@ template<typename Iterator>
 void Symbol_parser<Iterator>::setName(std::string n)
 {
     layout.setName(QString::fromUtf8(n.data(), n.size()));
-    //qDebug() << layout.getLayoutName();
+    //qCDebug(KEYBOARD_PREVIEW) << layout.getLayoutName();
 }
 
 template<typename Iterator>
@@ -148,7 +148,7 @@ void Symbol_parser<Iterator>::setLevel(int lvl)
 {
     if (lvl > layout.getLevel()) {
         layout.setLevel(lvl);
-        qDebug() << lvl;
+        qCDebug(KEYBOARD_PREVIEW) << lvl;
     }
 }
 
@@ -166,7 +166,7 @@ QString findLayout(const QString &layout, const QString &layoutVariant)
 
     QFile sfile(symbolFile);
     if (!sfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        //qDebug() << "unable to open the file";
+        //qCDebug(KEYBOARD_PREVIEW) << "unable to open the file";
         return QString("I/O ERROR");
     }
 
@@ -230,7 +230,7 @@ KbLayout parseSymbols(const QString &layout, const QString &layoutVariant)
     bool success = phrase_parse(iter, end, symbolParser, space);
 
     if (success && iter == end) {
-        qDebug() << "Symbols Parsing succeeded";
+        qCDebug(KEYBOARD_PREVIEW) << "Symbols Parsing succeeded";
         symbolParser.layout.setParsedSymbol(true);
 
     } else {
@@ -265,12 +265,12 @@ KbLayout parseSymbols(const QString &layout, const QString &layoutVariant)
         success = phrase_parse(iter, end, symbolParser, space);
 
         if (success && iter == end) {
-            qDebug() << "Symbols Parsing succeeded";
+            qCDebug(KEYBOARD_PREVIEW) << "Symbols Parsing succeeded";
             symbolParser.layout.setParsedSymbol(true);
 
         } else {
-            qDebug() << "Symbols Parsing failed\n";
-            qDebug() << input;
+            qCDebug(KEYBOARD_PREVIEW) << "Symbols Parsing failed\n";
+            qCDebug(KEYBOARD_PREVIEW) << input;
             symbolParser.layout.setParsedSymbol(false);
         }
 
diff --git a/kcms/keyboard/tests/flags_test.cpp b/kcms/keyboard/tests/flags_test.cpp
index 59f7371..fab8007 100644
--- a/kcms/keyboard/tests/flags_test.cpp
+++ b/kcms/keyboard/tests/flags_test.cpp
@@ -16,7 +16,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 #include <qtest_kde.h>
 #include <QtGui/QIcon>
 
diff --git a/kcms/keyboard/tests/geometry_parser_test.cpp b/kcms/keyboard/tests/geometry_parser_test.cpp
index 6534f02..8d6d254 100644
--- a/kcms/keyboard/tests/geometry_parser_test.cpp
+++ b/kcms/keyboard/tests/geometry_parser_test.cpp
@@ -22,6 +22,7 @@
 #include "../preview/geometry_parser.h"
 
 
+Q_LOGGING_CATEGORY(KCM_KEYBOARD, "kcm_keyboard")
 
 class GeometryParserTest : public QObject
 {
diff --git a/kcms/keyboard/tests/iso_codes_test.cpp b/kcms/keyboard/tests/iso_codes_test.cpp
index 886f566..a84ed5a 100644
--- a/kcms/keyboard/tests/iso_codes_test.cpp
+++ b/kcms/keyboard/tests/iso_codes_test.cpp
@@ -16,13 +16,14 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 #include <QApplication>
 #include <qtest_kde.h>
 
 #include "../iso_codes.h"
 
 
+Q_LOGGING_CATEGORY(KCM_KEYBOARD, "kcm_keyboard")
+
 class IsoCodesTest : public QObject
 {
     Q_OBJECT
diff --git a/kcms/keyboard/tests/keyboard_daemon_test.cpp b/kcms/keyboard/tests/keyboard_daemon_test.cpp
index 8879daf..1c207db 100644
--- a/kcms/keyboard/tests/keyboard_daemon_test.cpp
+++ b/kcms/keyboard/tests/keyboard_daemon_test.cpp
@@ -16,7 +16,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 //#include <kapplication.h>
 
 #include <qtest_kde.h>
diff --git a/kcms/keyboard/tests/layout_memory_persister_test.cpp \
b/kcms/keyboard/tests/layout_memory_persister_test.cpp index 0dd0c74..78289bf 100644
--- a/kcms/keyboard/tests/layout_memory_persister_test.cpp
+++ b/kcms/keyboard/tests/layout_memory_persister_test.cpp
@@ -16,7 +16,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 #include <QtGui/QApplication>
 #include <qtest_kde.h>
 
diff --git a/kcms/keyboard/tests/xkb_rules_test.cpp b/kcms/keyboard/tests/xkb_rules_test.cpp
index daef508..63bcbe9 100644
--- a/kcms/keyboard/tests/xkb_rules_test.cpp
+++ b/kcms/keyboard/tests/xkb_rules_test.cpp
@@ -16,7 +16,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include <kdebug.h>
 #include <QApplication>
 #include <qtest_kde.h>
 
@@ -25,6 +24,10 @@
 #include <qdom.h>
 #include <qxml.h>
 
+
+Q_LOGGING_CATEGORY(KCM_KEYBOARD, "kcm_keyboard")
+
+
 static const Rules::ExtrasFlag readExtras = Rules::NO_EXTRAS;
 
 class RulesTest : public QObject
@@ -189,7 +192,7 @@ private Q_SLOTS:
 
     	QFile file("base2.xml");
         if( ! file.open( QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text) ) {
-        	kWarning() << "Failed to open layout memory xml file for writing" << file.fileName();
+        	qWarning() << "Failed to open layout memory xml file for writing" << file.fileName();
         	QFAIL("failed");
         }
 
diff --git a/kcms/keyboard/x11_helper.cpp b/kcms/keyboard/x11_helper.cpp
index de77a89..b857014 100644
--- a/kcms/keyboard/x11_helper.cpp
+++ b/kcms/keyboard/x11_helper.cpp
@@ -36,6 +36,8 @@
 #include <fixx11h.h>
 
 
+Q_LOGGING_CATEGORY(KCM_KEYBOARD, "kcm_keyboard")
+
 // more information about the limit https://bugs.freedesktop.org/show_bug.cgi?id=19501
 const int X11Helper::MAX_GROUP_COUNT = 4;
 const int X11Helper::ARTIFICIAL_GROUP_LIMIT_COUNT = 8;
@@ -180,8 +182,8 @@ QList<LayoutUnit> X11Helper::getLayoutsList()
 //				if( layouts[i].layout == layouts[j].layout && layouts[i].getRawDisplayName().isEmpty() ) {
 //					layouts[i].setDisplayName( addNum(layouts[i].layout, 1) );
 //					layouts[j].setDisplayName( addNum(layouts[j].layout, ++n) );
-//					qDebug() << "Adding" << 1 << "to" << layouts[i].toString();
-//					qDebug() << "Adding" << n << "to" << layouts[j].toString();
+//					qCDebug(KCM_KEYBOARD) << "Adding" << 1 << "to" << layouts[i].toString();
+//					qCDebug(KCM_KEYBOARD) << "Adding" << n << "to" << layouts[j].toString();
 //				}
 //			}
 //		}
@@ -194,7 +196,7 @@ QList<LayoutUnit> X11Helper::getLayoutsList()
 
 bool X11Helper::setGroup(unsigned int group)
 {
-    qDebug() << group;
+    qCDebug(KCM_KEYBOARD) << group;
     xcb_void_cookie_t cookie;
     cookie = xcb_xkb_latch_lock_state(QX11Info::connection(),
         XCB_XKB_ID_USE_CORE_KBD,
@@ -206,7 +208,7 @@ bool X11Helper::setGroup(unsigned int group)
     xcb_generic_error_t *error = 0;
     error = xcb_request_check(QX11Info::connection(), cookie);
     if (error) {
-        qDebug() << "Couldn't change the group" << error->error_code;
+        qCDebug(KCM_KEYBOARD) << "Couldn't change the group" << error->error_code;
         return false;
     }
 
@@ -259,7 +261,7 @@ bool X11Helper::getGroupNames(Display* display, XkbConfig* xkbConfig, FetchType
 		return false;
 	}
 
-//	qDebug() << "prop_data:" << nitems << prop_data;
+//	qCDebug(KCM_KEYBOARD) << "prop_data:" << nitems << prop_data;
 	QStringList names;
 	for(char* p=prop_data; p-prop_data < (long)nitems && p != NULL; p += strlen(p)+1) {
 		names.append( p );
@@ -279,21 +281,21 @@ bool X11Helper::getGroupNames(Display* display, XkbConfig* xkbConfig, FetchType
 			xkbConfig->layouts << (layouts[ii] != NULL ? layouts[ii] : "");
 			xkbConfig->variants << (ii < variants.count() && variants[ii] != NULL ? variants[ii] : "");
 		}
-		qDebug() << "Fetched layout groups from X server:"
+		qCDebug(KCM_KEYBOARD) << "Fetched layout groups from X server:"
 				<< "\tlayouts:" << xkbConfig->layouts
 				<< "\tvariants:" << xkbConfig->variants;
 	}
 
 	if( fetchType == ALL || fetchType == MODEL_ONLY ) {
 		xkbConfig->keyboardModel = (names[1] != NULL ? names[1] : "");
-		qDebug() << "Fetched keyboard model from X server:" << xkbConfig->keyboardModel;
+		qCDebug(KCM_KEYBOARD) << "Fetched keyboard model from X server:" << xkbConfig->keyboardModel;
 	}
 
 	if( fetchType == ALL ) {
 		if( names.count() >= 5 ) {
 			QString options = (names[4] != NULL ? names[4] : "");
 			xkbConfig->options = options.split(OPTIONS_SEPARATOR);
-			qDebug() << "Fetched xkbOptions from X server:" << options;
+			qCDebug(KCM_KEYBOARD) << "Fetched xkbOptions from X server:" << options;
 		}
 	}
 
@@ -311,7 +313,7 @@ XEventNotifier::XEventNotifier():
 
 void XEventNotifier::start()
 {
-	qDebug() << "qCoreApp" << QCoreApplication::instance();
+	qCDebug(KCM_KEYBOARD) << "qCoreApp" << QCoreApplication::instance();
 	if( QCoreApplication::instance() != NULL && X11Helper::xkbSupported(&xkbOpcode) ) {
 		registerForXkbEvents(QX11Info::display());
 
diff --git a/kcms/keyboard/x11_helper.h b/kcms/keyboard/x11_helper.h
index 2fc1b60..86f9ce8 100644
--- a/kcms/keyboard/x11_helper.h
+++ b/kcms/keyboard/x11_helper.h
@@ -26,6 +26,10 @@
 #include <QWidget>
 #include <QX11Info>
 #include <QAbstractNativeEventFilter>
+#include <QLoggingCategory>
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
 
 #include <xcb/xcb.h>
 //#include <xcb/xkb.h>
diff --git a/kcms/keyboard/xinput_helper.cpp b/kcms/keyboard/xinput_helper.cpp
index 432bb4f..f4d72f1 100644
--- a/kcms/keyboard/xinput_helper.cpp
+++ b/kcms/keyboard/xinput_helper.cpp
@@ -103,20 +103,20 @@ int XInputEventNotifier::getNewDeviceEventType(xcb_generic_event_t* event)
 			int ndevices;
 			XDeviceInfo	*devices = XListInputDevices(xdpne->display, &ndevices);
 			if( devices != NULL ) {
-//				kDebug() << "New device id:" << xdpne->deviceid;
+//				qCDebug(KCM_KEYBOARD, ) << "New device id:" << xdpne->deviceid;
 				for(int i=0; i<ndevices; i++) {
-//					kDebug() << "id:" << devices[i].id << "name:" << devices[i].name << "used as:" << devices[i].use;
+//					qCDebug(KCM_KEYBOARD, ) << "id:" << devices[i].id << "name:" << devices[i].name << "used as:" << \
devices[i].use;  if( devices[i].id == xdpne->deviceid ) {
 						if( devices[i].use == IsXKeyboard || devices[i].use == IsXExtensionKeyboard ) {
 							if( isRealKeyboard(devices[i].name) ) {
 								newDeviceType = DEVICE_KEYBOARD;
-								qDebug() << "new keyboard device, id:" << devices[i].id << "name:" << devices[i].name << "used \
as:" << devices[i].use; +								qCDebug(KCM_KEYBOARD) << "new keyboard device, id:" << devices[i].id << \
"name:" << devices[i].name << "used as:" << devices[i].use;  break;
 							}
 						}
 						if( devices[i].use == IsXPointer || devices[i].use == IsXExtensionPointer ) {
 							newDeviceType = DEVICE_POINTER;
-							qDebug() << "new pointer device, id:" << devices[i].id << "name:" << devices[i].name << "used \
as:" << devices[i].use; +							qCDebug(KCM_KEYBOARD) << "new pointer device, id:" << devices[i].id << \
"name:" << devices[i].name << "used as:" << devices[i].use;  break;
 						}
 					}
@@ -136,7 +136,7 @@ int XInputEventNotifier::registerForNewDeviceEvent(Display* display)
 
 	DevicePresence(display, xitype, xiclass);
 	XSelectExtensionEvent(display, DefaultRootWindow(display), &xiclass, 1);
-	qDebug() << "Registered for new device events from XInput, class" << xitype;
+	qCDebug(KCM_KEYBOARD) << "Registered for new device events from XInput, class" << xitype;
 	xinputEventType = xitype;
 	return xitype;
 }
diff --git a/kcms/keyboard/xinput_helper.h b/kcms/keyboard/xinput_helper.h
index 343d7ed..9251530 100644
--- a/kcms/keyboard/xinput_helper.h
+++ b/kcms/keyboard/xinput_helper.h
@@ -25,6 +25,12 @@
 #include <X11/Xlib.h>
 #include <fixx11h.h>
 
+#include <QLoggingCategory>
+
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
+
+
 class XInputEventNotifier: public XEventNotifier {
 	Q_OBJECT
 
diff --git a/kcms/keyboard/xkb_helper.cpp b/kcms/keyboard/xkb_helper.cpp
index 1deea03..d36ffb0 100644
--- a/kcms/keyboard/xkb_helper.cpp
+++ b/kcms/keyboard/xkb_helper.cpp
@@ -79,7 +79,7 @@ void executeXmodmap(const QString& configFileName)
     	KProcess xmodmapProcess;
     	xmodmapProcess << xmodmapExe;
     	xmodmapProcess << configFileName;
-    	qDebug() << "Executing" << xmodmapProcess.program().join(" ");
+    	qCDebug(KCM_KEYBOARD) << "Executing" << xmodmapProcess.program().join(" ");
     	if( xmodmapProcess.execute() != 0 ) {
     		qCritical() << "Failed to execute " << xmodmapProcess.program();
     	}
@@ -107,9 +107,9 @@ bool XkbHelper::runConfigLayoutCommand(const QStringList& setxkbmapCommandArgume
 	int res = setxkbmapProcess.execute();
 
 	if( res == 0 ) {	// restore Xmodmap mapping reset by setxkbmap
-		qDebug() << "Executed successfully in " << timer.elapsed() << "ms" << \
setxkbmapProcess.program().join(" "); +		qCDebug(KCM_KEYBOARD) << "Executed successfully in " << \
timer.elapsed() << "ms" << setxkbmapProcess.program().join(" ");  restoreXmodmap();
-		qDebug() << "\t and with xmodmap" << timer.elapsed() << "ms";
+		qCDebug(KCM_KEYBOARD) << "\t and with xmodmap" << timer.elapsed() << "ms";
 	    return true;
 	}
 	else {
diff --git a/kcms/keyboard/xkb_rules.cpp b/kcms/keyboard/xkb_rules.cpp
index 9271e18..1adbacc 100644
--- a/kcms/keyboard/xkb_rules.cpp
+++ b/kcms/keyboard/xkb_rules.cpp
@@ -44,6 +44,7 @@
 #include <config-workspace.h>
 
 
+
 class RulesHandler : public QXmlDefaultHandler
 {
 public:
@@ -147,7 +148,7 @@ QString Rules::getRulesName()
 	char *tmp = NULL;
 
 	if (XkbRF_GetNamesProp(QX11Info::display(), &tmp, &vd) && tmp != NULL ) {
-		// 			qDebug() << "namesprop" << tmp ;
+		// 			qCDebug(KCM_KEYBOARD) << "namesprop" << tmp ;
                 const QString name(tmp);
                 XFree(tmp);
 		return name;
@@ -214,7 +215,7 @@ void mergeRules(Rules* rules, Rules* extraRules)
 		}
 	}
 	rules->layoutInfos.append(layoutsToAdd);
-	qDebug() << "Merged from extra rules:" << extraRules->layoutInfos.size() << "layouts," << \
extraRules->modelInfos.size() << "models," << extraRules->optionGroupInfos.size() << "option groups"; \
+	qCDebug(KCM_KEYBOARD) << "Merged from extra rules:" << extraRules->layoutInfos.size() << "layouts," << \
extraRules->modelInfos.size() << "models," << extraRules->optionGroupInfos.size() << "option groups";  
 	// base rules now own the objects - remove them from extra rules so that it does not try to delete them
 	extraRules->layoutInfos.clear();
@@ -262,7 +263,7 @@ Rules* Rules::readRules(Rules* rules, const QString& filename, bool fromExtras)
 
 	QXmlInputSource xmlInputSource(&file);
 
-	qDebug() << "Parsing xkb rules from" << file.fileName();
+	qCDebug(KCM_KEYBOARD) << "Parsing xkb rules from" << file.fileName();
 
 	if( ! reader.parse(xmlInputSource) ) {
 		qCritical() << "Failed to parse the rules file" << file.fileName();
@@ -299,7 +300,7 @@ bool RulesHandler::startElement(const QString &/*namespaceURI*/, const QString &
 	}
 	else if( strPath == ("xkbConfigRegistry") && ! attributes.value("version").isEmpty()  ) {
 		rules->version = attributes.value("version");
-		qDebug() << "xkbConfigRegistry version" << rules->version;
+		qCDebug(KCM_KEYBOARD) << "xkbConfigRegistry version" << rules->version;
 	}
 	return true;
 }
@@ -317,57 +318,57 @@ bool RulesHandler::characters(const QString &str)
 		if( strPath.endsWith("layoutList/layout/configItem/name") ) {
 			if( rules->layoutInfos.last() != NULL ) {
 				rules->layoutInfos.last()->name = str.trimmed();
-//				qDebug() << "name:" << str;
+//				qCDebug(KCM_KEYBOARD) << "name:" << str;
 			}
 			// skipping invalid entry
 		}
 		else if( strPath.endsWith("layoutList/layout/configItem/description") ) {
 			rules->layoutInfos.last()->description = str.trimmed();
-//			qDebug() << "descr:" << str;
+//			qCDebug(KCM_KEYBOARD) << "descr:" << str;
 		}
 		else if( strPath.endsWith("layoutList/layout/configItem/languageList/iso639Id") ) {
 			rules->layoutInfos.last()->languages << str.trimmed();
-//			qDebug() << "\tlang:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tlang:" << str;
 		}
 		else if( strPath.endsWith("layoutList/layout/variantList/variant/configItem/name") ) {
 			rules->layoutInfos.last()->variantInfos.last()->name = str.trimmed();
-//			qDebug() << "\tvariant name:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tvariant name:" << str;
 		}
 		else if( strPath.endsWith("layoutList/layout/variantList/variant/configItem/description") ) {
 			rules->layoutInfos.last()->variantInfos.last()->description = str.trimmed();
-//			qDebug() << "\tvariant descr:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tvariant descr:" << str;
 		}
 		else if( strPath.endsWith("layoutList/layout/variantList/variant/configItem/languageList/iso639Id") ) \
{  rules->layoutInfos.last()->variantInfos.last()->languages << str.trimmed();
-//			qDebug() << "\tvlang:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tvlang:" << str;
 		}
 		else if( strPath.endsWith("modelList/model/configItem/name") ) {
 			rules->modelInfos.last()->name = str.trimmed();
-//			qDebug() << "name:" << str;
+//			qCDebug(KCM_KEYBOARD) << "name:" << str;
 		}
 		else if( strPath.endsWith("modelList/model/configItem/description") ) {
 			rules->modelInfos.last()->description = str.trimmed();
-//			qDebug() << "\tdescr:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tdescr:" << str;
 		}
 		else if( strPath.endsWith("modelList/model/configItem/vendor") ) {
 			rules->modelInfos.last()->vendor = str.trimmed();
-//			qDebug() << "\tvendor:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tvendor:" << str;
 		}
 		else if( strPath.endsWith("optionList/group/configItem/name") ) {
 			rules->optionGroupInfos.last()->name = str.trimmed();
-//			qDebug() << "name:" << str;
+//			qCDebug(KCM_KEYBOARD) << "name:" << str;
 		}
 		else if( strPath.endsWith("optionList/group/configItem/description") ) {
 			rules->optionGroupInfos.last()->description = str.trimmed();
-//			qDebug() << "\tdescr:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tdescr:" << str;
 		}
 		else if( strPath.endsWith("optionList/group/option/configItem/name") ) {
 			rules->optionGroupInfos.last()->optionInfos.last()->name = str.trimmed();
-//			qDebug() << "name:" << str;
+//			qCDebug(KCM_KEYBOARD) << "name:" << str;
 		}
 		else if( strPath.endsWith("optionList/group/option/configItem/description") ) {
 			rules->optionGroupInfos.last()->optionInfos.last()->description = str.trimmed();
-//			qDebug() << "\tdescr:" << str;
+//			qCDebug(KCM_KEYBOARD) << "\tdescr:" << str;
 		}
 	}
 	return true;
@@ -454,7 +455,7 @@ Rules::GeometryId Rules::getGeometryId(const QString& model) {
     	    QString groupName = parts[1];
     	    QStringList models = parts[2].split(QRegExp("\\s+"), QString::SkipEmptyParts);
     	    
-//    	    qDebug() << "modelGroup definition" << groupName << ":" << models;
+//    	    qCDebug(KCM_KEYBOARD) << "modelGroup definition" << groupName << ":" << models;
     	    if( models.contains(model) ) {
     	        modelGeoId = groupName;
     	    }
@@ -483,7 +484,7 @@ Rules::GeometryId Rules::getGeometryId(const QString& model) {
     		defaultGeoId = GeometryId(fileName, geoName);
     	    }
     	    
-//    	    qDebug() << "geo entry" << modelName << fileName << geoName;
+//    	    qCDebug(KCM_KEYBOARD) << "geo entry" << modelName << fileName << geoName;
         
     	    if( modelName == model ) {
     		return GeometryId(fileName, geoName);
diff --git a/kcms/keyboard/xkb_rules.h b/kcms/keyboard/xkb_rules.h
index a64600d..ecebd6d 100644
--- a/kcms/keyboard/xkb_rules.h
+++ b/kcms/keyboard/xkb_rules.h
@@ -20,9 +20,12 @@
 #ifndef XKB_RULES_H_
 #define XKB_RULES_H_
 
-#include <QtXml/QXmlDefaultHandler>
-#include <QtCore/QList>
-#include <QtCore/QStringList>
+#include <QXmlDefaultHandler>
+#include <QList>
+#include <QStringList>
+#include <QLoggingCategory>
+
+Q_DECLARE_LOGGING_CATEGORY(KCM_KEYBOARD)
 
 
 struct ConfigItem {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic