[PATCH] kshortcutsdialog.cpp

Michael Jansen info at michael-jansen.biz
Sat Feb 16 21:04:17 GMT 2008


Hi

Attached is a patch that fixes the "systemsettings" -> 
"keyboard&mouse" -> "keyboard shortcuts" dialog. 

After clicking into the Action column of the treeview the layout get's 
messed up. That's because the code activates a item in a hidden 
column and then let's KExtendableItem work with that item.

Michael Jansen



-------------- next part --------------
Index: kdelibs/kdeui/dialogs/kshortcutsdialog.cpp
===================================================================
--- kdelibs/kdeui/dialogs/kshortcutsdialog.cpp	(revision 775601)
+++ kdelibs/kdeui/dialogs/kshortcutsdialog.cpp	(working copy)
@@ -232,8 +232,16 @@
 
 	int column = index.column();
 	if (column == Name) {
-		index = model->index(index.row(), LocalPrimary, index.parent());
-		column = LocalPrimary;
+		// If user click in the name column activate the (Global|Local)Primary
+		// column if possible.
+		if (!view->header()->isSectionHidden(LocalPrimary)) {
+			column = LocalPrimary;
+		} else if (!view->header()->isSectionHidden(GlobalPrimary)) {
+			column = GlobalPrimary;
+		} else {
+			// do nothing.
+		}
+		index = model->index(index.row(), column, index.parent());
 		view->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect);
 	}
 


More information about the kde-core-devel mailing list