Usage of libkundo2 in Calligra (Qt's maximal dependency)

C. Boemann cbo at
Fri May 13 18:33:33 BST 2011

On Friday 13 May 2011 19:23:10 Alexander Potashev wrote:
> Hi,
> I've recently "pushed through" a patch to Qt 4.8
> ( that will allow
> usage of different text in "Edit -> Undo %1"/"Redo %1" and "Undo
> History" dockwidget. "Undo History" is only implemented in Krita.
> But since this feature will only be available in Qt 4.8, and Calligra
> will probably depend on it in a year, may be it's worth using a
> replacement library to take advantage of the same feature without
> waiting for new release of Qt?
> How to use Qt 4.8's features without Qt 4.8: instead of QUndo* classes
> (it's called Qt's Undo Framework,
>, the whole Calligra can use
> my library libkundo2 ( which
> is a fork of Qt's Undo Framework.
> In order to port Calligra to libkundo2, you should run the script
> "" from libkundo2 repository inside the calligra
> sources' root directory. There is also a script for backward porting
> -- "". Running "forward-port" and then "backward-port"
> will still give you a diff, because the format of #include-s is not
> uniform throughout Calligra. See that diff in the attached file
> "calligra-includes.diff".
> Besides running the script, you should also link libkundo2's shared
> library to those Calligra's libraries and applications that previously
> used Qt's Undo Framework. You can find the patch doing this in the
> attached file "0001-link-kundo2.patch".
> Why we should use libkundo2 in the whole Calligra, not just in Krita:
> Krita uses the class KoDocument that operates with QUndoStack. If we
> switch Krita to libkundo2, we will have to also switch Calligra's core
> libraries to it, and then the whole Calligra.
> But before starting using libkundo2, we firstly need to add
> dependencies on it to CMakeLists.txt files and probably move
> libkundo2's source code to
> P.S. The second patch that has been merged to Qt 4.8 is
>, libkundo2 also
> fixes that bug.
> P.P.S. I'm doing all this, because Russian translators had a few
> discussions on how text of undoable commands should be translated to
> fit both the "Edit -> Undo %1" commands and the "Undo History" panel
> in Krita, Step and probably some other applications. There are some
> workarounds possible to do in translations (for example, using a
> colon, like "Undo: %1", to indicate that the text of the menu item is
> expected not to be a complete word collocation), but they are not
> perfect.
I don't think our core libraries should depend on an unreleased private 
library. So if we want this I only see two possible routes:

1. get libkundo2 released and wait until all distributions have picked it up 
and released with it. Meaning that qt 4.8 might be available at the same time.

2. add the library inside the Calligra repository.

Casper Boemann

More information about the calligra-devel mailing list