Bug 98852 - custom c++ project: add/remove files broken
Summary: custom c++ project: add/remove files broken
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Custom Makefiles (show other bugs)
Version: 3.1.91
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 16:02 UTC by Daniel Franke
Modified: 2005-11-24 19:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A patch to fix the bug by using the file path rather than the name. (785 bytes, patch)
2005-03-24 15:56 UTC, David Guthrie
Details

Note You need to log in before you can comment on or make changes to this bug.
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