From kde-devel Mon Jan 29 16:21:19 2007 From: Stephan Johach Date: Mon, 29 Jan 2007 16:21:19 +0000 To: kde-devel Subject: Re: Use of KStandardAction / actionCollection()->action() in trunk Message-Id: <200701291721.19118.lucardus () onlinehome ! de> X-MARC-Message: https://marc.info/?l=kde-devel&m=117008662427580 Hi David! Am Montag 29 Januar 2007, 00:17:34 schrieb David Faure: > On Saturday 27 January 2007 15:46, Stephan Johach wrote: > > Hi all! > > > > I am trying to get catalogmanager working in trunk but it crashes on > > startup due to the use of a KToggleAction pointer which is 0. > > > > The code is the following: > > > > kdesdk/kbabel/catalogmanager/catalogmanager.cpp > > > > KToggleAction * toggle = (KToggleAction*)actionCollection()-> > > action(KStandardAction::stdName(KStandardAction::ShowStatusbar)); > > > > toggle->setChecked(!statusBar()->isHidden() ); > > > > In KDE 3.5 it obviously worked but I can not find out why > > actionCollection()->action( ... ) returns 0 in trunk. I know there were > > changes regarding KAction in trunk but I am lost here. > > The action now needs to be added to the collection using > addAction("name",action), after it has been created. Can you check if > addAction is called for that action? No, at least I can not find the corresponding code. But what about KMainWindow::createStandardStatusBarAction()? It calls d->showStatusBarAction = KStandardAction::showStatusbar(this, SLOT(setSettingsDirty()), actionCollection()); Isn't it supposed to supply the showStatusbar action? It is called in catalogmanager before trying to get the action object from actionCollection(). Stephan >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<