KXMLGUI question

Christoph Cullmann crossfire at babylon2k.de
Sun Apr 21 13:23:36 BST 2002


Hi,
I just try to use kxmlgui in kate app to embed the kate part actions (which 
are at the moment hardcoded, the actions of the part aren't used).

I got following problem:
I use addClient/removeClient of the mainwindow guiFactory() to remove the old 
kate::view xmlguiclient on view change and add the xmlguiclient of the new 
current active kate::view, but only the icons in the menus/toolbars get the 
new actions, the shortcuts always be the shortcuts of the last created 
Kate::view. even after removeClient :(.

(yes, much casts atm, but that is my local quick and dirty hack version ;)

activeView is a guardedptr to the current active view and the following stuff 
happens if "view" becomes the new active view (on deletion of a view 
removeClient happens automagically elsewhere).

   if (((KateMainWindow *)topLevelWidget ())->activeView)
      ((KMainWindow *)topLevelWidget ())->guiFactory()->removeClient ( 
((KateMainWindow *)topLevelWidget ())->activeView );
  
    ((KateMainWindow *)topLevelWidget ())->activeView = view;
    
    if (((KateMainWindow *)topLevelWidget ())->activeView)
      ((KMainWindow *)topLevelWidget ())->guiFactory ()->addClient( view );



Any ideas ? If someone thinks I have only made a little failure which is 
easily to fix, I will commit my new code to kdebase/kate ;)



cu
Christoph

-- 
Christoph "Crossfire" Cullmann
Kate/KDE developer
cullmann at kde.org
http://kate.kde.org




More information about the kde-core-devel mailing list