setupGUI and kparts

Benjamin Meyer ben at meyerhome.net
Fri Jul 2 20:47:13 BST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I noticed that in kmainwindow the configureToolbars function doesn't work if 
you are using kparts.  I played around with it and come up with this 
solution, but I don't know if there are edge cases that I am missing as I 
don't know the kparts system well enough.  Can someone with more expertease 
in this area take a quick glance at this and let me know if it is good to 
commit?

- -Benjamin Meyer


Index: kmainwindow.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmainwindow.cpp,v
retrieving revision 1.132
diff -u -3 -p -r1.132 kmainwindow.cpp
- --- kmainwindow.cpp   10 Jun 2004 14:12:14 -0000        1.132
+++ kmainwindow.cpp   2 Jul 2004 19:38:19 -0000
@@ -426,7 +426,12 @@ KXMLGUIFactory *KMainWindow::guiFactory(
 int KMainWindow::configureToolbars()
 {
     saveMainWindowSettings(KGlobal::config());
- -    KEditToolbar dlg(guiFactory(), this, "KEditToolbar");
+    if(!(actionCollection()->isEmpty())){
+       KEditToolbar dlg(actionCollection(), xmlFile(), this, false, 
"KEditToolbar");
+       connect(&dlg, SIGNAL(newToolbarConfig()), 
SLOT(saveNewToolbarConfig()));
+       return dlg.exec();
+   }
+    KEditToolbar dlg(guiFactory(), this, "KEditToolbar");
     connect(&dlg, SIGNAL(newToolbarConfig()), SLOT(saveNewToolbarConfig()));
     return dlg.exec();
 }

- -- 
aka icefox
Public Key: http://www.csh.rit.edu/~benjamin/public_key.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFA5bvB1rZ3LTw38vIRAuqIAJ4okqyqPj0aWZBAY4HhSX68lnSfgACgpvDz
h7OPAp/glOIm9W5MbJjUt6c=
=ehtK
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list