Replacement for Qt's Undo Framework

Alexander Potashev aspotashev at gmail.com
Tue Apr 26 17:33:42 BST 2011


2011/4/26 Albert Astals Cid <aacid at kde.org>:
>> I kept the arguments of UndoCommand() the same, but now if you put
>> something like "Create a document|-|creation of a document" as the
>> "text" into the constructor (or translate it with a similar string
>> with "|-|"), you'll get "Create a document" as the name of an item in
>> Undo History panel, and the "Undo ..." menu item will be called "Undo
>> creation of a document".
>
> This approach seems a bit too fragile to "wrong/careless" translations, though
> i guess we can always add it to the pology checks

I didn't mention it, but traditional undo command names (w/o "|-|")
work in KUndo2 exactly like in plain QUndoCommands (see the "else"
block in https://github.com/aspotashev/libkundo2/blob/master/src/kundostack2.cpp#L267).
Nothing is going to be broken unless you accidentally but "|-|" in
your translation not knowing what that means (i.e. translators and
developers can just ignore this functionality).


-- 
Alexander Potashev




More information about the kde-core-devel mailing list