When the files are not in the project's root folder, C::B will display the files like this:
(http://i.min.us/ilFPg0.png)
It's painful to explorer the files in my project as the items are too long. On the contrary, VS will display only the file name without the full path.
Er, I known that I have a really bad programming style, but this is really a big problem to me...
Is there a way to fix it for me?
Thanks.
Yes, the normal behaviour is http://www.codeblocks.org/images/stories/imagebrowser/scr1.png
Right click on the project and play with the options. Also you should look in Project -> Project tree.
I don't have C::B here, so I can't tell you the name of the option...
Quote from: oBFusCATed on February 25, 2011, 05:43:05 PM
Yes, the normal behaviour is http://www.codeblocks.org/images/stories/imagebrowser/scr1.png
Right click on the project and play with the options. Also you should look in Project -> Project tree.
I don't have C::B here, so I can't tell you the name of the option...
It's harder to open levels of folders, and I think the VS style is the best - no full path only the file name.
There are virtual folders for such users, not exactly like VS, but something similar
Quote from: oBFusCATed on February 25, 2011, 07:16:52 PM
There are virtual folders for such users, not exactly like VS, but something similar
The result is the same: :)
(http://i.min.us/ijCq14.png)
Try checking "Display Folders as on Disk" under "Project Tree"
Tim S.
This sounds interesting, so I made a patch that will do what you want. It adds the menu option "Project -> Project Tree -> Show Filenames only". Seems to work, but I haven't tested extensively.
The patch was taken from latest svn of the debugger branch (hopefully, would also work on trunk)
dmoore: have you tested it with something like:
src/file1.cpp
src/path1/file1.cpp
src/path2/file1.cpp
:lol:
Quote from: oBFusCATed on February 26, 2011, 08:42:33 PM
dmoore: have you tested it with something like:
src/file1.cpp
src/path1/file1.cpp
src/path2/file1.cpp
:lol:
It "works" (as well as it can). Two identical names appear in the tree each referring to a distinct item. Sort order is weird though.
updated patch. sorts by filename instead of full path if "show filename only" is selected.
one feature is still missing: the tree should show a tooltip giving the full path to help user distinguish files with identical names.
Quote from: dmoore on February 26, 2011, 10:42:22 PM
updated patch. sorts by filename instead of full path if "show filename only" is selected.
Hi dmoore,
please don't go for it any further. I have a patch pending for a while now that does that. It works slightly different than your approach, but it recognises / handles virtual folders and alike better.
I'll try to extract a single "stand-alone" patch though, as it is combined with a some other modifications...
...patch for trunk is here (attached).
Please give it a try!
Morten: your patch works as advertised. You should probably grab the sorting part of my patch. It looks weird to have identical names show up in different places on the tree. Also, I didn't see an easy way to provide tooltips that give the full path that works on non MSW. Is there an easy fix?
Quote from: MortenMacFly on February 27, 2011, 10:24:31 AM
but it recognises / handles virtual folders and alike better.
I thought my version left them alone the same way your patch does, but I guess I might have missed some important cases. No worries on the wasted duplication of effort.
Quote from: dmoore on February 28, 2011, 02:56:10 AM
You should probably grab the sorting part of my patch.
Yes, I'll take care.
Quote from: dmoore on February 28, 2011, 02:56:10 AM
Also, I didn't see an easy way to provide tooltips that give the full path that works on non MSW. Is there an easy fix?
I'll try...
Quote from: dmoore on February 28, 2011, 02:56:10 AM
No worries on the wasted duplication of effort.
A pity anyways... There is still something to come like drag/dropping multiple file (e.g. between /into virtual folders). So be careful when touching projectmanager / cbproject. ;-)
@morten:
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing... :shock:
Compiling: sdk\cbproject.cpp
C:\Work\codeblocks_trunk\src\sdk\cbproject.cpp: In member function 'void cbProject::BuildTree(wxTreeCtrl*, const wxTreeItemId&, int, FilesGroupsAndMasks*)':
C:\Work\codeblocks_trunk\src\sdk\cbproject.cpp:845:22: error: 'filesSortNameOnly' was not declared in this scope
Quote from: daniloz on February 28, 2011, 09:20:59 AM
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing... :shock:
...try again.
Quote from: MortenMacFly on February 28, 2011, 10:11:16 AM
Quote from: daniloz on February 28, 2011, 09:20:59 AM
After updating to rev.7030, which includes your patch to "* allow to hide the folder name in project tree (in "flat view" mode)", I cannot compile anymore, it seems something (filesSortNameOnly) is still missing... :shock:
...try again.
Working now, thanks !!!!