Using the KomparePart in KDevelop

Andreas Pakulat apaku at gmx.de
Fri Jul 17 00:21:45 UTC 2009


On 16.07.09 17:09:00, Killerfox wrote:
> Hello List, I am the GSoC student working on refactoring support for KDevelop. 
> Right now I am working on a dialog to show the users the changes made by a 
> plugin, and then allowing them to change something if they don't find it 
> accurate.
> 
> I want to embed a KomparePart into the dialog. However it has been quite hard 
> to find documentation about how to use a KomparePart. From what I have 
> gathered it is preferred to create a KPart through KMimeTypeTrader, however I 
> won't be working with diff files, but with two versions of the file, and I was 
> hoping that Kompare could do the diff, and display the changes.
> 
> So could anyone here point me in the right direction on how to go about this?

Well, the kompare interface is in
kdesdk/kompare/interfaces/kompareinterface.h. And there's a compare(
url1, url2 ) function there that seems suitable :) 

So all you need to do is create a KParts::Part* instance and
dynamic_cast it to the KompareInterface class. Creating the part can be
done in KDevelop via PartController::createPart(), but we'll have to
expose that somehow in the interfaces library as its currently in shell/
only.

Andreas 

-- 
You feel a whole lot more like you do now than you did when you used to.


More information about the Kompare-devel mailing list