[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [plasma-desktop/amourphious/keyboard] kcms/keyboard: fixed more wanrings !
From: shivam makkar <amourphious1992 () gmail ! com>
Date: 2014-05-29 7:42:02
Message-ID: E1WpuyQ-0005G6-Pw () scm ! kde ! org
[Download RAW message or body]
Git commit 11ea64508b503dfd7a0a720cd6e1162df946afe2 by shivam makkar.
Committed on 19/05/2014 at 19:41.
Pushed by makkar into branch 'amourphious/keyboard'.
fixed more wanrings !
M +7 -6 kcms/keyboard/bindings.cpp
M +1 -1 kcms/keyboard/flags.cpp
M +3 -2 kcms/keyboard/keyboard_config.cpp
M +3 -3 kcms/keyboard/keyboard_daemon.cpp
M +2 -2 kcms/keyboard/keyboard_hardware.cpp
M +11 -11 kcms/keyboard/layout_memory.cpp
M +13 -12 kcms/keyboard/layout_memory_persister.cpp
M +3 -3 kcms/keyboard/layouts_menu.cpp
http://commits.kde.org/plasma-desktop/11ea64508b503dfd7a0a720cd6e1162df946afe2
diff --git a/kcms/keyboard/bindings.cpp b/kcms/keyboard/bindings.cpp
index 21541e0..325dd3c 100644
--- a/kcms/keyboard/bindings.cpp
+++ b/kcms/keyboard/bindings.cpp
@@ -18,14 +18,15 @@
#include "bindings.h"
-#include <kdebug.h>
+
#include <kactioncollection.h>
#include <kaction.h>
#include <klocalizedstring.h>
#include <kglobalaccel.h>
#include <kaboutdata.h>
-#include <QtCore/QList>
+#include <QList>
+#include <QDebug>
#include "x11_helper.h"
#include "flags.h"
@@ -109,7 +110,7 @@ void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit>& layou
createLayoutShortcutActon(layoutUnit, rules, false);
}
}
- kDebug() << "Cleaning component shortcuts on save" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
+ qDebug() << "Cleaning component shortcuts on save" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
}
void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit>& layoutUnits, const Rules* \
rules) @@ -119,15 +120,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();
+ qDebug() << "Restored shortcut for" << layoutUnit.toString() << shortcut.first();
layoutUnit.setShortcut(shortcut.first());
}
else {
- kDebug() << "Skipping empty shortcut for" << layoutUnit.toString();
+ qDebug() << "Skipping empty shortcut for" << layoutUnit.toString();
removeAction(action);
}
}
- kDebug() << "Cleaning component shortcuts on load" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
+ qDebug() << "Cleaning component shortcuts on load" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
}
//KAction* KeyboardLayoutActionCollection::getAction(const LayoutUnit& layoutUnit)
diff --git a/kcms/keyboard/flags.cpp b/kcms/keyboard/flags.cpp
index b768586..6d25443 100644
--- a/kcms/keyboard/flags.cpp
+++ b/kcms/keyboard/flags.cpp
@@ -18,7 +18,7 @@
#include "flags.h"
-#include <kdebug.h>
+//#include <kdebug.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <kglobalsettings.h>
diff --git a/kcms/keyboard/keyboard_config.cpp b/kcms/keyboard/keyboard_config.cpp
index f3ff97c..49f059c 100644
--- a/kcms/keyboard/keyboard_config.cpp
+++ b/kcms/keyboard/keyboard_config.cpp
@@ -20,8 +20,9 @@
#include <ksharedconfig.h>
#include <kconfiggroup.h>
-#include <kdebug.h>
+//#include <kdebug.h>
+#include <QDebug>
static const char* SWITCHING_POLICIES[] = {"Global", "Desktop", "WinClass", "Window", NULL };
static const char* LIST_SEPARATOR = ",";
@@ -143,7 +144,7 @@ void KeyboardConfig::load()
// }
// }
- kDebug() << "configuring layouts" << configureLayouts << "configuring options" << resetOldXkbOptions;
+ qDebug() << "configuring layouts" << configureLayouts << "configuring options" << \
resetOldXkbOptions; }
void KeyboardConfig::save()
diff --git a/kcms/keyboard/keyboard_daemon.cpp b/kcms/keyboard/keyboard_daemon.cpp
index 25673b0..dcda1ec 100644
--- a/kcms/keyboard/keyboard_daemon.cpp
+++ b/kcms/keyboard/keyboard_daemon.cpp
@@ -21,8 +21,8 @@
#include <QX11Info>
#include <QtDBus/QtDBus>
#include <QProcess>
+#include <QDebug>
-#include <kdebug.h>
#include <kpluginfactory.h>
#include <kaction.h>
#include <kactioncollection.h>
@@ -93,7 +93,7 @@ KeyboardDaemon::~KeyboardDaemon()
void KeyboardDaemon::configureKeyboard()
{
- kDebug() << "Configuring keyboard";
+ qDebug() << "Configuring keyboard";
init_keyboard_hardware();
keyboardConfig.load();
@@ -224,7 +224,7 @@ void KeyboardDaemon::layoutMapChanged()
void KeyboardDaemon::switchToNextLayout()
{
- kDebug() << "Toggling layout";
+ qDebug() << "Toggling layout";
X11Helper::switchToNextLayout();
}
diff --git a/kcms/keyboard/keyboard_hardware.cpp b/kcms/keyboard/keyboard_hardware.cpp
index dca49b6..9a61159 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 <X11/Xlib.h>
@@ -43,7 +43,7 @@ static
void set_repeatrate(int delay, double rate)
{
if( !X11Helper::xkbSupported(NULL) ) {
- kError() << "Failed to set keyboard repeat rate: xkb is not supported";
+ qDebug() << "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..d78e677 100644
--- a/kcms/keyboard/layout_memory.cpp
+++ b/kcms/keyboard/layout_memory.cpp
@@ -20,8 +20,8 @@
#include <QSet>
#include <QX11Info>
+#include <QDebug>
-#include <kdebug.h>
#include <kwindowsystem.h>
#include "x11_helper.h"
@@ -72,7 +72,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;
+ qDebug() << "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 +86,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;
+ qDebug() << "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 +96,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();
+ qDebug() << "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 +127,20 @@ void LayoutMemory::layoutMapChanged()
if( prevLayoutList == newLayoutList )
return;
- kDebug() << "Layout map change: " << LayoutSet::toString(prevLayoutList) << "-->" << \
LayoutSet::toString(newLayoutList); + qDebug() << "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";
+ qDebug() << "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";
+ qDebug() << "Layout map change from external source: clearing layout memory";
layoutMap.clear();
// }
}
@@ -162,10 +162,10 @@ void LayoutMemory::setCurrentLayoutFromMap()
return;
if( ! layoutMap.contains(layoutMapKey) ) {
-// kDebug() << "new key for layout map" << layoutMapKey;
+// qDebug() << "new key for layout map" << layoutMapKey;
if( ! X11Helper::isDefaultLayout() ) {
-// kDebug() << "setting default layout for container key" << layoutMapKey;
+// qDebug() << "setting default layout for container key" << layoutMapKey;
if( keyboardConfig.configureLayouts && keyboardConfig.isSpareLayoutsEnabled()
&& X11Helper::getLayoutsList() != keyboardConfig.getDefaultLayouts() ) {
XkbHelper::initializeKeyboardLayouts(keyboardConfig.getDefaultLayouts());
@@ -175,7 +175,7 @@ void LayoutMemory::setCurrentLayoutFromMap()
}
else {
LayoutSet layoutFromMap = layoutMap[layoutMapKey];
- kDebug() << "Setting layout map item" << layoutFromMap.currentLayout.toString()
+ qDebug() << "Setting layout map item" << layoutFromMap.currentLayout.toString()
<< "for container key" << layoutMapKey;
LayoutSet currentLayouts = X11Helper::getCurrentLayouts();
@@ -200,7 +200,7 @@ void LayoutMemory::windowChanged(WId /*wId*/)
{
// KPluginInfo::List plugins = Plasma::Containment::listContainments();
// foreach(KPluginInfo info, plugins) {
-// kDebug() << "applets" << info.name();
+// qDebug() << "applets" << info.name();
// }
setCurrentLayoutFromMap();
}
diff --git a/kcms/keyboard/layout_memory_persister.cpp b/kcms/keyboard/layout_memory_persister.cpp
index 8a6118a..1dba024 100644
--- a/kcms/keyboard/layout_memory_persister.cpp
+++ b/kcms/keyboard/layout_memory_persister.cpp
@@ -18,14 +18,15 @@
#include "layout_memory_persister.h"
-#include <kdebug.h>
+
#include <kconfiggroup.h>
#include <ksharedconfig.h>
#include <kstandarddirs.h>
-#include <QtCore/QFile>
+#include <QFile>
#include <QtXml/qdom.h>
#include <QtXml/qxml.h>
+#include <QDebug>
#include "keyboard_config.h"
#include "layout_memory.h"
@@ -88,7 +89,7 @@ QString LayoutMemoryPersister::getLayoutMapAsString()
static bool isRestoreSession()
{
KConfigGroup c(KSharedConfig::openConfig("ksmserverrc", KConfig::NoGlobals), "General");
- kDebug() << "loginMode:" << c.readEntry("loginMode");
+ qDebug() << "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 }
@@ -122,7 +123,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();
+ qDebug() << "Failed to open layout memory xml file for writing" << file.fileName();
return false;
}
@@ -131,13 +132,13 @@ bool LayoutMemoryPersister::saveToFile(const QFile& file_)
out.flush();
if( file.error() != QFile::NoError ) {
- kWarning() << "Failed to store keyboard layout memory, error" << file.error();
+ qDebug() << "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();
+ qDebug() << "Keyboard layout memory stored into" << file.fileName() << "written" << file.pos();
return true;
}
}
@@ -214,7 +215,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(); + qDebug() << "Failed to open layout memory xml file for reading" << file.fileName() \
<< "error:" << file.error(); return false;
}
@@ -225,17 +226,17 @@ bool LayoutMemoryPersister::restoreFromFile(const QFile& file_)
reader.setErrorHandler(&mapHandler);
QXmlInputSource xmlInputSource(&file);
- kDebug() << "Restoring keyboard layout map from" << file.fileName();
+ qDebug() << "Restoring keyboard layout map from" << file.fileName();
if( ! reader.parse(xmlInputSource) ) {
- kWarning() << "Failed to parse the layout memory file" << file.fileName();
+ qDebug() << "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();
+ qDebug() << "Restored global layout" << globalLayout.toString();
}
}
else {
@@ -245,7 +246,7 @@ bool LayoutMemoryPersister::restoreFromFile(const QFile& file_)
layoutMemory.layoutMap.insert(key, mapHandler.layoutMap[key]);
}
}
- kDebug() << "Restored layouts for" << layoutMemory.layoutMap.size() << "containers";
+ qDebug() << "Restored layouts for" << layoutMemory.layoutMap.size() << "containers";
}
return true;
}
@@ -254,7 +255,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";
+ qDebug() << "Not saving session for window mode";
}
return !windowMode;
}
diff --git a/kcms/keyboard/layouts_menu.cpp b/kcms/keyboard/layouts_menu.cpp
index fd436c4..e357c6a 100644
--- a/kcms/keyboard/layouts_menu.cpp
+++ b/kcms/keyboard/layouts_menu.cpp
@@ -18,11 +18,11 @@
#include "layouts_menu.h"
-#include <kmenu.h>
+//#include <kmenu.h>
#include <ktoolinvocation.h>
#include <klocalizedstring.h>
-#include <kdebug.h>
+#include <QDebug>
#include <QAction>
#include <QMenu>
@@ -81,7 +81,7 @@ int LayoutsMenu::switchToLayout(const LayoutUnit& layoutUnit, const KeyboardConf
res = X11Helper::setLayout(layoutUnit);
}
else {
- kWarning() << "switchToLayout with unknown layout" << layoutUnit.toString();
+ qDebug() << "switchToLayout with unknown layout" << layoutUnit.toString();
res = -1;
}
return res;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic