[Kst] Concerns with current copy implementation
staikos at kde.org
Tue Jan 11 23:37:37 CET 2005
I'm a bit concerned about the design/implementation of the current copy code.
It's good that it's in layout mode now, but I think the architecture is a bit
off. Here's why:
1) Copy&Paste is not usable with the new functions added since they
immediately do the copy and paste.
2) It depends too heavily on _parent, which we're trying to remove. It can be
implemented efficiently without it.
3) It would be useful for DnD too if implemented differently (as I suggested,
something like KstViewObjectPtr duplicate() const;)
4) It mixes the "action" copy with the concept of copying a view object, which
is abstract and reusable elsewhere.
5) Copy as an action should be toplevel. There's no need to propagate it
lower. Only duplication of object properties is object-implementation
specific. I think Copy is a KstTopLevelView/KstViewWindow/KstApp action.
6) We actually need something more abstract for the concept of "copying" since
we sometimes don't want to create objects or duplicate until the "paste"
happens. This is particularly the case for DnD and traditional Copy+Paste.
Also useful for Undo/Redo I think. This is why KstViewObjects have the
byte-stream encoding mechanism, and I think this is probably the proper way
to implement all of this stuff.
KDE Developer http://www.kde.org/
Staikos Computing Services Inc. http://www.staikos.net/
More information about the Kst