Bug #9596 2006-12-02 23:23

blubz

Wrong path when adding files

I usually put my source files in a project's subdirectory called 'src'.

When I open a project, the browser correctly displays my sources in a source/src virtual view.

If I add a new file in the project, the file doesn't appear in 'sources/src', but in 'sources/my_project_name/src'.

if I reload the project, display is good again

Category
Application::Interface
Group
 
Status
Closed
Close date
2007-04-12 15:32
Assigned to
killerbot
killerbot 2006-12-06 19:18

which version are you using. I tried this out and it works OK.

Can you give a detailed step by step guide on how to reproduce. Thanks.

blubz 2006-12-06 21:53
I am using nightly build from november 26.
I successfully reproduced this inconvenience with build from december 6, BUT, I investigate and I have found why this is exactly happenning.


( and sorry for my poor english :) I can speak spanish or french if better :p )

** Step 1 :
I start with this physical project's tree :

/My_Project/
....|---My_Project.cbp
....|---/src_dir/
...........|----file1.cpp
...........|----file2.cpp
...........|----file3.cpp


** Step 2 :
I add source files which are NOT in the project's tree. The sources are on a dir in the same lvl of My_Project's dir like this :

/common_files/
....|---common_file1.cpp
....|---common_file2.cpp
/My_Project/
....|---My_Project.cbp
....|---/src_dir/
...........|----file1.cpp
...........|----file2.cpp
...........|----file3.cpp


At this point, the codeblock's browser displays the files like this :
(note: I am using both "categorize by filetype" and "display folders as on disk" )

.My_project
....|--- sources
..............|---common_files
........................|---common_file1.cpp
........................|---common_file2.cpp
..............|---src_dir
........................|---file1.cpp
........................|---file2.cpp
........................|---file3.cpp



** Step 3 : the bug ?

After that I want to add a new file in project "file4.cpp". 
I move it in 'src_dir', I right-click on the project's name in codeblocks and I choose "add files..", I select file4.cpp, and the browser becomes mad :

.My_project
....|--- sources
..............|---My_project
.....................|---src_dir
.............................|---file4.cpp
..............|---common_files
........................|---common_file1.cpp
........................|---common_file2.cpp
..............|---src_dir
........................|---file1.cpp
........................|---file2.cpp
........................|---file3.cpp

A subfolder with project's name has appeared magically.
If I create the same project without adding "common_files", then the bug never spawns.


Conclusion : is there something happening when adding files in project which are not physically inside the project ?


When I close the project ( after saving it ) and then I reopen it again, the browser's tree becomes fine.

That's all... I don't know if this could help, but this bug never fails on my system.

GL

killerbot 2006-12-15 18:50

good feedback, will try it out and fix it if I can reconstruct.

biplab 2007-04-12 15:32

@killerbot,

This bug has been fixed in Revision 3846. So I'm closing this bug-report.

@blubz

Thanks for your feedback.