public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in kde-base/systemsettings/files: systemsettings-4.7.3-fix-keyboard-layout-switch.patch
@ 2011-12-13 15:32 Johannes Huber (johu)
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Huber (johu) @ 2011-12-13 15:32 UTC (permalink / raw
  To: gentoo-commits

johu        11/12/13 15:32:18

  Added:               
                        systemsettings-4.7.3-fix-keyboard-layout-switch.patch
  Log:
  Revision bump. Add upstream backport patch to fix non standard global keyboard layout switch. Fixes bug #394491 Thanks to Denis Scherbakov <denis_scherbakov@yahoo.comi>.
  
  (Portage version: 2.2.0_alpha80/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  kde-base/systemsettings/files/systemsettings-4.7.3-fix-keyboard-layout-switch.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/systemsettings/files/systemsettings-4.7.3-fix-keyboard-layout-switch.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/systemsettings/files/systemsettings-4.7.3-fix-keyboard-layout-switch.patch?rev=1.1&content-type=text/plain

Index: systemsettings-4.7.3-fix-keyboard-layout-switch.patch
===================================================================
commit 1ac5ebe482f633295fb4a79eb1c5236561e9ca70
Author: Andriy Rysin <arysin@gmail.com>
Date:   Fri Nov 18 23:12:14 2011 -0500

    Fix keyboard layout global shortcuts
    BUG: 286302

diff --git a/kcontrol/keyboard/bindings.cpp b/kcontrol/keyboard/bindings.cpp
index 6f5af7b..ac20dd9 100644
--- a/kcontrol/keyboard/bindings.cpp
+++ b/kcontrol/keyboard/bindings.cpp
@@ -103,8 +103,11 @@ void KeyboardLayoutActionCollection::setLayoutShortcuts(QList<LayoutUnit>& layou
 {
 	for (QList<LayoutUnit>::iterator i = layoutUnits.begin(); i != layoutUnits.end(); ++i) {
 		LayoutUnit& layoutUnit = *i;
-		createLayoutShortcutActon(layoutUnit, rules, false);
+		if( ! layoutUnit.getShortcut().isEmpty() ) {
+			createLayoutShortcutActon(layoutUnit, rules, false);
+		}
 	}
+	kDebug() << "Cleaning component shortcuts on save" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
 }
 
 void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit>& layoutUnits, const Rules* rules)
@@ -112,19 +115,27 @@ void KeyboardLayoutActionCollection::loadLayoutShortcuts(QList<LayoutUnit>& layo
 	for (QList<LayoutUnit>::iterator i = layoutUnits.begin(); i != layoutUnits.end(); ++i) {
 		LayoutUnit& layoutUnit = *i;
 		KAction* action = createLayoutShortcutActon(layoutUnit, rules, true);
-		layoutUnit.setShortcut(action->globalShortcut(KAction::ActiveShortcut).primary());	// shortcut was restored
+		QKeySequence shortcut = action->globalShortcut(KAction::ActiveShortcut).primary();	// shortcut was restored
+		if( ! shortcut.isEmpty() ) {
+			kDebug() << "Restored shortcut for" << layoutUnit.toString() << shortcut;
+			layoutUnit.setShortcut(shortcut);
+		}
+		else {
+			kDebug() << "Skipping empty shortcut for" << layoutUnit.toString();
+			removeAction(action);
+		}
 	}
 	kDebug() << "Cleaning component shortcuts on load" << KGlobalAccel::cleanComponent(COMPONENT_NAME);
 }
 
-KAction* KeyboardLayoutActionCollection::getAction(const LayoutUnit& layoutUnit)
-{
-	for(int i=1; i<actions().size(); i++) {
-		if( action(i)->data() == layoutUnit.toString() )
-			return static_cast<KAction*>(action(i));
-	}
-	return NULL;
-}
+//KAction* KeyboardLayoutActionCollection::getAction(const LayoutUnit& layoutUnit)
+//{
+//	for(int i=1; i<actions().size(); i++) {
+//		if( action(i)->data() == layoutUnit.toString() )
+//			return static_cast<KAction*>(action(i));
+//	}
+//	return NULL;
+//}
 
 void KeyboardLayoutActionCollection::resetLayoutShortcuts()
 {
diff --git a/kcontrol/keyboard/bindings.h b/kcontrol/keyboard/bindings.h
index f60656b..09a9bdc 100644
--- a/kcontrol/keyboard/bindings.h
+++ b/kcontrol/keyboard/bindings.h
@@ -36,7 +36,7 @@ public:
 	virtual ~KeyboardLayoutActionCollection();
 
 	KAction* getToggeAction();
-	KAction* getAction(const LayoutUnit& layoutUnit);
+//	KAction* getAction(const LayoutUnit& layoutUnit);
 	KAction* createLayoutShortcutActon(const LayoutUnit& layoutUnit, const Rules* rules, bool autoload);
 //	KAction* setShortcut(LayoutUnit& layoutUnit, const QKeySequence& keySequence, const Rules* rules);
 	void setLayoutShortcuts(QList<LayoutUnit>& layoutUnits, const Rules* rules);
diff --git a/kcontrol/keyboard/keyboard_daemon.cpp b/kcontrol/keyboard/keyboard_daemon.cpp
index 1618d2a..7126268 100644
--- a/kcontrol/keyboard/keyboard_daemon.cpp
+++ b/kcontrol/keyboard/keyboard_daemon.cpp
@@ -214,12 +214,16 @@ void KeyboardDaemon::layoutMapChanged()
 
 void KeyboardDaemon::switchToNextLayout()
 {
+	kDebug() << "Toggling layout";
 	X11Helper::switchToNextLayout();
 }
 
 bool KeyboardDaemon::setLayout(QAction* action)
 {
-	LayoutUnit layoutUnit(LayoutUnit(action->data().toString()));
+	if( action == actionCollection->getToggeAction() )
+		return false;
+
+	LayoutUnit layoutUnit(action->data().toString());
 	return LayoutsMenu::switchToLayout(layoutUnit, keyboardConfig);	// need this to be able to switch to spare layouts
 //	return X11Helper::setLayout(LayoutUnit(action->data().toString()));
 }






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in kde-base/systemsettings/files: systemsettings-4.7.3-fix-keyboard-layout-switch.patch
@ 2012-02-21 15:27 Johannes Huber (johu)
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Huber (johu) @ 2012-02-21 15:27 UTC (permalink / raw
  To: gentoo-commits

johu        12/02/21 15:27:38

  Removed:             
                        systemsettings-4.7.3-fix-keyboard-layout-switch.patch
  Log:
  Remove old.
  
  (Portage version: 2.2.0_alpha86/cvs/Linux x86_64)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-21 15:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 15:32 [gentoo-commits] gentoo-x86 commit in kde-base/systemsettings/files: systemsettings-4.7.3-fix-keyboard-layout-switch.patch Johannes Huber (johu)
  -- strict thread matches above, loose matches on Subject: below --
2012-02-21 15:27 Johannes Huber (johu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox