Clarification on a VCS-Iface Issue

Andreas Pakulat apaku at gmx.de
Thu Sep 6 00:52:56 UTC 2007


On 05.09.07 19:16:54, Matt Rogers wrote:
> On Wednesday 05 September 2007 04:02, Andreas Pakulat wrote:
> > I think I don't really follow you. How can the user of the API provide a
> > function to customize the display when the versioning interface has no
> > idea about the user? Its currently a one-way-API, a user can call a
> > function from the Vcs API but the Vcs API doesn't know anything about
> > the user (wether its a script, a class from shell, or another plugin). I
> > think I need a bit more detail on this to understand.
> >
> 
> If you look at the docs for QItemDelegate, you can see it provides four 
> virtual functions for customizing the drawing. Reading the source, 
> QItemDelegate's paint() call calls each one of those virtual functions, 
> allowing the developer deriving from QItemDelegate to provide their own 
> custom drawing mechanism if they so choose. Most of the time though, it's not 
> needed, but the flexibility is there.  
> 
> We'd be doing the same sort of thing here.
> 
> Example: 
> 
> We have a diff() function that calls some "virtual void displayDiff()" 
> function, which, wherever it gets implemented, does something we want it to 
> do. Continuing with the above example, it'd open a new tab in KDevelop with 
> the output of the diff command as the text. the displayDiff function could be 
> overridden as needed to customize how the output is displayed.

ok, understood so far. Except one thing: I don't think I want more than
1 way of displaying a diff - well maybe two (one time as unified diff
inside kate, one time similar to kompar or kdiff3).

I can't quite imagine how an implementation could look like, I mean
where to put the virtual, the vcs plugins already have the option of
providing their own ui for any of the showXXX methods. And if not on the
vcs plugin, where else would this be? Should the Vcs plugin store state
then, like a "delegate" to render its ui? Would it make sense to do this
globally or on a per-project basis?

Andreas

-- 
Abandon the search for Truth; settle for a good fantasy.




More information about the KDevelop-devel mailing list