[Bug 64481] classparser does not recognice links or rel. paths to sourcefiles outside project dir

Roberto Raggi roberto at kdevelop.org
Tue Sep 23 14:22:31 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Andreas,

On Tuesday 23 September 2003 13:51, Andreas Koepfle wrote:
> Hi Roberto,
> the following patch fixes it for files with ../ in their file paths in my
> qmake manager projects, by just using the relative path to the files. To
> get it right for the symlinks is harder, as the project file list contains
> the symlink and you want to check if the real file is in the list. Hope to
> help.
I'm afraid that it isn't so simple :) the point is 
PartController::editDocument(..) (defined in kdevelop/src) resolves the link 
before open the editor! so, for instance the problem reporter will not be 
enabled if you call PartController::editDocument("<project-dir>/myfile.h") 
and myfile.h is a link to /usr/include/stdio.h. Maybe a possible solution 
could be to use a dictionary that maps absolute urls to project urls, 
something like

QMap<QString,QString> absoluteFileToProjectFile;
absoluteFileToProjectFile[ URLUtil::canonicalPath(fileName) ] = fileName;

where fileName is a project relative file. This dictionary can be computed 
using KDevProject::allFiles() when the project emits signals 
addedFilesToProject(),removeFilesFromProject(),...

in this way you can check if a file is a "project file" with
   absoluteFileToProjectFile.contains( absolute-url )
and the classbrowser can use the absoluteFileToProjectFile[ absolute-url ] for 
create the "folders".

ciao robe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/cDqMFprNbhKbO+8RArL9AKCSBG92Hv/c38iM5II8NqwI4XVGdwCeK95O
nnVPrsjnJsNKQOKtDUzSMjI=
=alf2
-----END PGP SIGNATURE-----




More information about the KDevelop-devel mailing list