Author Topic: Feature request: right click on project name to create new Directory  (Read 6701 times)

pledreau

  • Guest
Hello,

When I create a project(for example a console project) I'd like to organize the files in directories
for examples sources, includes and so on...
For this I'd like to right click on the project name and dispose of the command create dir
Then on the folder the command already exists(by right click)  and I can create sub-folder (if I want) or add files to the created directory
+--+sources
|                 |
|                 +module1
|                 |-source1.c
|                +module2
|                 |-source2.c
+--+includes
|                 |
|                 +module1
|                 |-source1.h
|                +module2
|                 |-source2.h

pledreau

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Feature request: right click on project name to create new Directory
« Reply #1 on: January 19, 2006, 03:17:47 pm »
And with that comes the ability to rename sources from the project manager, or to move them around... and things like that.

The problem with this is that currently, that is quite hard to achieve. Projects work on files, and if a folder contains no project files you will not be able to see it.
Unless we do a major redesign, we'll have to resort to a hack to enable features like this. And even then, there won't be an easy way.
Think of cvs and .svn folders -- you would not want these to appear in the project view. The problem is that there are a couple more of them, and neither do we know about all of them, nor are they standardised (for example, TortoiseSVN came up with folders called _svn instead of .svn because of some Windows fallacy, and this is now official, but the only way to know which one is used on a particular machine is to query an environment variable, which is a hack again).

Thus, we would have to keep track of Code::Blocks generated directories ourselves inside the project file... or something. But that again, is no good solution.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

pledreau

  • Guest
Re: Feature request: right click on project name to create new Directory
« Reply #2 on: January 19, 2006, 11:08:38 pm »
Thanks for your answer but why do you say that it isn't a good solution to keep track of generated directories inside the project file ?
msvc++ or dev c++,...for example, keep the directories in the project file. And it is more confortable to build the directories of the project.
To move files from one place to another, just with drag and drop. Delete the file from the project without deleting it from the disk.
I've tried to import a project from a .dsw file and the tree build with code::blocks doesn't match the msvc++ tree, and it's difficult to
adjust the project I have to build the real directory on the disk, then transfert the files in it then add them to the project...
Of course, it is quite hard to achieve that but it could be fine to have it.

best regards

pledreau

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Feature request: right click on project name to create new Directory
« Reply #3 on: January 20, 2006, 10:28:05 am »
IMO the roject should be organised on the harddisk, not in a project. That way it is easier to understand the project when you dan't want to use an IDE... but that is of course just my opinion ;)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

pledreau

  • Guest
Re: Feature request: right click on project name to create new Directory
« Reply #4 on: January 20, 2006, 11:02:13 am »
Hello,

Of course when the project is organised on the hard disk it's easier to understand, but for my case every developper here work with msvc++.
And the project organisation is in the project file so I can't say "hey, I'd like to use code::blocks but it is necessary to reorganise all the project for this" :? It's the reason why I say it could be fine to have it for adaptability, this functionnality could helps if the project isn't organise on the hard disk but also if it is.You haven't the need to leave the IDE to create directories because it' integrated ...
So I stop there the thread, if no body is interrest with it that doesn't matter...
it was just a proposition!! :)

best regards

pledreau

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Feature request: right click on project name to create new Directory
« Reply #5 on: January 20, 2006, 11:15:05 am »
It is not that nobody is interested... it is just not so trivial to implement.

Right now, projects hold files. Since every file obviously has to be inside some folder, this defines the folders for the project at the same time. There can be no misunderstanding.

If you keep additional directory information in the project file, then you can have directories independent of files. But the problem is that you are duplicating volatile data here, and that will run you into problems sooner or later unless you take extra precautions.
For example, what happens if a user deletes an empty folder from the hard disk? This seems like a pretty normal thing to do, and it is certainly allowed. I did that once with Dev-CPP, and the result was that it crashed as soon as I clicked into the project window, and the project file was corrupted beyond repair. This is the kind of behaviour which I am afraid of.
Of course, such crashes can be avoided by adding a lot of extra checks, but like I said: it is certainly possible, but not so easy.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

takeshimiya

  • Guest
Re: Feature request: right click on project name to create new Directory
« Reply #6 on: January 20, 2006, 11:33:50 am »
My rationale is that, MSVC supports that, and a user coming from an IDE that supports that (let's call it virtual directiories) can be a bit shocking. HOWEVER, I think it's far easier and better to do the organization right on the real filesystem, and that should be encouraged.

So, the question would be: C::B should do what it thinks it's the best behaviour, or, let the user do whatever he wants, at the cost of (maybe) confusing them? (appart from what thomas says that it's true: it's not trivial to implement).