KStandardAction::showMenubar() lacks collection->addAction()

Christian Esken esken at kde.org
Sat Jun 23 00:46:12 BST 2007


Am Freitag, 22. Juni 2007 14:26 schrieb David Faure:
> On Wednesday 20 June 2007, Christian Esken wrote:
> > kstandardaction.cpp looks guilty, as it calls KStandardAction::create() (and this calls collection->addAction() ) for virtually all actions, except showMenubar(), showToolbar() and fullScreen().
> > 
> > Is this intendend behaviour or a bug?
>
> Anyhow I agree, kstandardaction should be consistent so please add the missing addAction
> calls to the special actions that are missing it.
> 
> The documentation of kstandardaction should also mention the automatic addition to the collection, too.
> 
> > But it also has to be done for showToolbar() and fullScreen()
> Yes.

I did that for showMenubar() and showToolbar(). I didn't do it for fullScreen(), because it actually calls KStandardAction::create(), so it should be OK. I also added to the documentation (as recommended).

By the way. The shortcut for hide and show (CTRL-m) doesn't work. I then moved the QObject::connect() after setting the Shortcut, but only hiding works by keyboard shortcut. 

> 
> > , and I wonder why there is a switch case for ShowMenubar in KStandardAction::create(), if it isn't called. 
> Historical reasons; initially it was a plain KAction then it became a toggle action with more behavior
> (setCheckedState).... hehe and then the setCheckedState calls were removed...
> Maybe it can be retrofitted into KStandardAction::create() again :-)

I read the source. But it looks too different - at least for me: In short: I didn't dare to touch it.

As far as I see the patch is binary-, source- and semantically-compatible. Should I commit it? On Monday?

  Christian

-- 
Things should be made as simple as possible, but no simpler. 
  - Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kstandardaction.diff
Type: text/x-diff
Size: 2108 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070623/bdd8d981/attachment.diff>


More information about the kde-core-devel mailing list