KDE/kdelibs/kdeui/xmlgui

Friedrich W. H. Kossebau kossebau at kde.org
Thu Jan 1 23:45:20 GMT 2009


Am Freitag, 2. Januar 2009, um 00:29 Uhr, schrieb Friedrich W. H. Kossebau:
> Patch? None so far. Bedtime for me now.

Unsolved problem and bedtime? Sure... first patch, which seems to work the 
last five minutes.

--- 8< --------
Index: kdelibs/kdeui/actions/kstandardaction.cpp
===================================================================
--- kdelibs/kdeui/actions/kstandardaction.cpp   (Revision 903572)
+++ kdelibs/kdeui/actions/kstandardaction.cpp   (Arbeitskopie)
@@ -206,9 +206,9 @@
       QObject::connect(pAction, SIGNAL(urlSelected(const KUrl &)), recvr, 
slot);
   }

-  KActionCollection *collection = qobject_cast<KActionCollection *>(parent);
-  if (pAction && collection)
-      collection->addAction(pAction->objectName(), pAction);

   return pAction;
 }
--- 8< --------

Lines can be removed because any call of StandardAction::create from 
KActionCollection is followed by a addAction() in KActionCollection itself.
No idea about subclasses of KActionCollection, who might expect this 
behaviour. At least it is not documented in the APIDOX. Are there any 
subclasses of KActionCollection which could be hurt by this behaviour change?

Please test this patch, it looks pretty save, to my tired eyes at least ;)

Cheers
Friedrich
-- 
Okteta - KDE 4 Hex Editor - http://utils.kde.org/projects/okteta




More information about the kde-core-devel mailing list