KActionCollection: it's a jungle
David Faure
faure at kde.org
Sun Mar 18 23:16:51 GMT 2007
On Sunday 18 March 2007, Andreas Hartmetz wrote:
> Some are really amusing, like addDocCollection() whose documentation goes like
> that:
> "Doc/View model. This lets you add the action collection of a document to a
> view's action collection."
Ellis started in that direction after getting requests from the KOffice developers in particular,
for support for the following use case (in kde3) :
In KOffice each a document can potentially have N views. Common design.
The document itself being a KParts::ReadOnlyPart, it has an action collection.
For instance, the undo/redo actions are (well, were) part of the document.
But an action wanted to know about one widget which would receive keystrokes for that
action, so having one action potentially plugged into N mainwindows was troublesome.
This is why Ellis added addDocCollection, but I'm not sure the support for that was
ever finished, and in any case it was never used by koffice.
All this being said, I indeed think it can be removed now, since Qt [and kdeui] solve
the undo/redo action issue differently (one can now create one undo action per view,
for the same undo history). Just providing some context to explain why things are
as they are ;)
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list