Patch for includepathresolver.cpp

Christoph Bartoschek bartoschek at or.uni-bonn.de
Wed May 27 16:22:20 UTC 2009


Hi,

a bug that bothered me quite long was that starting from kdevelop4 lots of 
code got recompiled without me changing it.

Yesterday I found the cause: Kdevelop changes the timestamp of my files.

After digging into the problem I found that the include path resolver uses 
different working directories for updating the timestamp and resetting them. 
This causes some files to not be resetted.

I've fixed this by the following means:

- Files are accessed and modified only by their canonical name.
- The canonical name is stored in the map.
- The map is a hash map because the values do not have to be sorted.
- If a file appears twice in the list the reset code might overwrite the 
correct timestamp. Changing the same file twice is prevented.
- Files that do not exist are not accessed.

Please apply the patch to get the correct behaviour by default.

However there are two questions left:

1. How to handle the errors that occur during such operations. For example if 
one do not has the permission to modify the files. In my opinion a global 
section of the Problems Tab is the correct place. How to add it there? The 
user should not be bothered with such problems during his work but the 
problems should not be ignored. They should be part of a logfile or something 
similar. Is there a logging mechanism for kdevelop for optimized runs? I think 
that kDebug is not an option here.

2. KDevelop has several places where the same file can appear twice becauses 
of symlinks. Shouldn't one use only one instance for each file? For example I 
have three entries of the same file in QuickOpen because I have two links to 
it within my project. Sometimes I have the impression this hinders the code 
completion. If the canonical file path is within the project directory the 
solution is to use the canonical file path. Otherwise the path should be 
relative to the project root. It might be hard to decide which path is the 
best one.

Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipr.patch
Type: text/x-patch
Size: 7444 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090527/e910f417/attachment.patch>


More information about the KDevelop-devel mailing list