Autoproject part patch

Julian Rockey linux at jrockey.com
Thu Jan 9 20:06:05 UTC 2003


On Thursday 09 Jan 2003 9:40 am, Victor Röder wrote:
> Hi,
>
> >The attached patch makes the autoproject a bit smarter about adding files
> > via the addFiles() method (i.e. from outside of the part).
> >
...
>
> One question:
>
> 1) Do you remember that the files you pass to addFiles() MUST be
> relative to the project directory? (Just for certainty :-)

Yes.. and without a leading '/' too...  so, OK to commit?

Actually, this brings me onto another point: it would be nice if addFiles() 
could tell whether it was being given just a filename, or a pathname relative 
to the project dir. Then, if it was being given only a filename, it could try 
to add to the active target. If it were being given a pathname, it could try 
some stuff as per my patch, or bring up the dialog.

If this were the case, other parts could either call addFiles, saying "The 
user's asked to create a file called foo.bar, but hasn't told me where to put 
it in the project", or call it saying "The user's asked to create a file 
called foo.bar in directory src/subproject1/subproject2".

At present addFiles can't tell the difference between being passed only a 
filename, and being passed a file in the home directory of the project.

Turning this into a mini-RFC.. this is actually what I'm trying to achieve 
with my FileCreate part. I'd like the interface to be able to be invoked from 
anywhere in Gideon to create a file. The part requesting a new file can 
supply as much or as little info about the file as it wishes - filename, 
path, file extension, template type. The FileCreate part will fill in the 
rest by asking the user. This centralises the job of new-file-creation. I 
realise this is of less interest to the C++ parts than others - the New Class 
function does the job here -- but I reckon it could work well for script 
projects, .ui files, etc.

cheers
Julian





More information about the KDevelop-devel mailing list