The future of KAction

Alexander Dymo adymo at mksat.net
Sat Nov 19 12:25:32 GMT 2005


On Saturday 19 November 2005 12:55, Simon Hausmann wrote:
> > bool MyWindow::actionFilter(KAction *action, const QString &menu,
> > 	const QString &group)
> > {
> > 	if (menu == "settings")
> > 		return false;
> > 	else if ((menu == "view") && (group == "navigation"))
> > 	{
> > 		if (action->objectName() == "go back")
> > 			return false;
> > 		return true;
> > 	}
> > 	return true;
> > }
>
> I think it would be a lot easier to just make addActionGroup on the
> plugin's side do nothing if the action group is not defined. The
> application can then decide whether to provide such a placeholder or not.

Yes, that would be easier to do but we already have smth similar with xml
files and that's not flexible enough.

Let's take a look at KDevelop + embedded Kate problem.

Kate defines 26 actions and separators for the "tools_operations" group
under the "tools" menu. There's nothing wrong with that but for KDevelop
we don't need several actions, say "set_filetype", "tools_uppercase", etc.
They are in the same group but we'd still want to remove them from the GUI.
That's why I propose we have an actionFilter(). Usually it will not be used,
group filtering will just work for most cases. But I can see some
applications like KDevelop and Quanta using action filters.




More information about the kde-core-devel mailing list