Hi && KDevProject

Jens Dagerbo jens.dagerbo at swipnet.se
Tue Apr 8 17:52:04 UTC 2003


Hi all,

Maybe I should introduce myself, as I kind of just jumped in uninvited. :) My 
name is Jens Dagerbo (aka "teatime" in #kdevelop) and I'm an ex-windoze 
programmer (win32/COM/Java). I've used Linux/KDE for my desktop for years, 
but only recently gotten around to try coding for the platform. One reason 
for this is the alien environment a developer meets when trying to make the 
transition ( the largest hurdle being the autotools). KDevelop is one of the 
tools that really makes it easier, and if I can help this project I'm happy. 
:)

My contributions have thus far only been the ReplacePart and a few patches 
(thanks to Amilcar for applying.) but the workings of the replace part creates 
issues I think is best solved in a generic fashion, and this I suspect will 
touch a fairly central part of gideon - KDevProject.

OK, that sounded serious, it isn't really. 

The general problem is this: There needs to be a way for a part to notify 
other parts of a project that the files in the project has changed.

The particular problem is this: When the ReplacePart changes files directly on 
disk and not through an editor buffer, there is currently no good way of 
letting the cpp parser know that this has happened. As a consequence, the 
classview can't be updated with the new data. (This is currently solved by 
simply telling the parser via a dcop signal to reparse. This makes no sense 
since the replace part is of course language agnostic.) 

I've been grepping and asking and reading, and while it's possible (even 
probable) that I'm overlooking something, my proposal is this:

Make it possible to not only add/remove, but also _change_ files in a project 
by adding two methods and one signal to KDevProject (kdevproject.h).

methods:
changedFile(const QString & file) 
changedFiles(const QStringList & fileList) 

signal: 
changedFilesInProject(const QStringList & fileList) 

This is a generic solution that fits very well with the existing architecture 
(as far as I understand it). It'll accommodate those who need the 
information, and not place any burden on those who don't. It will also be 
available for other (future) parts that, like the replace part, needs to do 
things with project files on disk.

The changedFile(s) methods are called from the part responsible (in this case 
the replace part) when a change has been made and KDevProject just dispatches 
that info as a signal.

(The methods are simple enough to even be _implemented_ in kdevpart.cpp, so 
none of the subclasses need even be touched, and if they actually need this 
info, they'll just reimplement them.)

IMHO, the change is sane, easy to implement and solves the issue in a generic 
way, but being a newbie I'm obviously not going to just submit this as a 
patch. 

Input requested. :)

// teatime






More information about the KDevelop-devel mailing list