[rkward-cvs] SF.net SVN: rkward:[2570] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Jul 23 14:28:24 UTC 2009


Revision: 2570
          http://rkward.svn.sourceforge.net/rkward/?rev=2570&view=rev
Author:   tfry
Date:     2009-07-23 14:28:23 +0000 (Thu, 23 Jul 2009)

Log Message:
-----------
Always reload xml when switching parts. It seems the only way to sync shortcut changes, reliably.

Modified Paths:
--------------
    trunk/rkward/rkward/rkward.cpp
    trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp

Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp	2009-07-23 10:34:42 UTC (rev 2569)
+++ trunk/rkward/rkward/rkward.cpp	2009-07-23 14:28:23 UTC (rev 2570)
@@ -387,6 +387,20 @@
 void RKWardMainWindow::partChanged (KParts::Part *part) {
 	RK_TRACE (APP);
 
+	/* Changes in shortcut-settings are not automatically synced between all action collections. Therefore, if we change between parts with the same actions, the new part simply does not have any changes that happend while the other part was active.
+	Reliably detecting such changes seems impossible (QAction::changed() gets emitted all the time for all sorts of non-interesting changes as well). So what we do is simply make sure we sync the KXMLGUI-files each time we switch to a new part. Fortunately, the performance impact appears to be small. */
+
+	// first: find out, which window is about to be activated
+	if (part) {
+		QList<RKMDIWindow*> list = RKWorkplace::mainWorkplace ()->getObjectList ();
+		for (int i = 0; i < list.count (); ++i) {
+			if (list[i]->getPart () == part) {
+				// now reload XML and apply customizations
+				list[i]->fixupPartGUI (true);
+				break;
+			}
+		}
+	}
 	createGUI (part);
 
 	if (!guiFactory ()) {

Modified: trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp
===================================================================
--- trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp	2009-07-23 10:34:42 UTC (rev 2569)
+++ trunk/rkward/rkward/windows/rktoplevelwindowgui.cpp	2009-07-23 14:28:23 UTC (rev 2570)
@@ -121,13 +121,6 @@
 	}
 	dlg.addCollection (RKComponentMap::getMap ()->actionCollection (), i18n ("RKWard Plugins"));
 	dlg.configure (true);
-
-	// we need to update all MDI windows, even if they are not currently in the factory.
-	// (they may share some or all shortcuts of the currently active window)
-	QList<RKMDIWindow*> list = RKWorkplace::mainWorkplace ()->getObjectList ();
-	for (int i = 0; i < list.count (); ++i) {
-		list[i]->fixupPartGUI (true);
-	}
 }
 
 void RKTopLevelWindowGUI::invokeRHelp () {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list