Bug 98852

Summary: custom c++ project: add/remove files broken
Product: [Applications] kdevelop Reporter: Daniel Franke <franke.daniel>
Component: Build tools: Custom MakefilesAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: greg_g
Priority: NOR    
Version: 3.1.91   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A patch to fix the bug by using the file path rather than the name.

Description Daniel Franke 2005-02-08 16:02:37 UTC
Version:           3.1.91 (CVS) (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3 
OS:                Linux

(kdevelop CVS-050202)

 * Import Existing Project -> Generic C++ Application (Custom Makefiles)

 * the project is populated with any (*.cpp|*.h) files found 

 * copy a file from somewhere

 * File Tree -> RMB to copied file -> Add to Project -> nothing seems to happen

I found that an empty line is appended to $PROJECT.kdevelop.filelist any time I add a file to the project.

Files already in the project can't be removed - the context menu just offers to add them again ...
Comment 1 Søren Holm 2005-03-18 01:41:53 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 David Guthrie 2005-03-23 21:19:12 UTC
The following simple patch to ./buildtools/custommakefiles/customprojectpart.cpp  fixes the bug

191,192c191,193
<         QString contextFileName = URLUtil::canonicalPath(fcontext->urls().first().fileName());
<         bool inProject = project()->isProjectFile(contextFileName);
---
>         QString contextFileName = URLUtil::canonicalPath(fcontext->urls().first().path());
>
>       bool inProject = project()->isProjectFile(contextFileName);
Comment 3 Matt Rogers 2005-03-24 03:45:46 UTC
if you could redo the diff with "diff -u" and attach it the bugreport, that
would be great. Thanks. :)
Comment 4 David Guthrie 2005-03-24 15:56:54 UTC
Created attachment 10323 [details]
A patch to fix the bug by using the file path rather than the name.

Uses the path to the file rather than the file name, so that files not in the
root of the project can be added or removed
Comment 5 David Guthrie 2005-06-01 16:13:45 UTC
I resubmitted the patch some time ago.  Has anyone attempted to test this?  I downloaded 3.2.1 and had to apply my own patch because it didn't make it into the release.
Comment 6 Søren Holm 2005-06-01 18:22:01 UTC
I have tried the patch against 3.2.0. It works perfectly
Comment 7 Jordi Blasi 2005-06-29 09:00:31 UTC
Thanks David Guthrie,
Your patch works for me also against 3.2.0 release.
Comment 8 Alexander Neundorf 2005-11-24 19:42:13 UTC
Fixed in svn, relative and absolute paths were not handled correctly. The patch was slightly more complicated than the one suggested here.
http://lists.kde.org/?l=kde-commits&m=113285732705490&w=2

Alex