User forums > Using Code::Blocks
Auto Save?
MortenMacFly:
--- Quote from: johnfemiani on September 03, 2007, 07:55:40 am ---Visual studio saves ALL modified files, but C::B only saves the ones that are in the project. Sometimes header files come from a different project, or may not be added to the project at all.
--- End quote ---
Well you don't really want C::B to save whatever files you have opened before compilation?! :shock:
I know that if this would be implemented other people surely will start complaining (and I believe they would be right).
Why don't you just make the project setup correct and tell C::B what files really belong to the project?!
With regards, Morten.
johnfemiani:
But AutoSave saves all files, ... this is just using the "build" event as a trigger in addition to using the clock.
In VS it is an option (so of course it can be turned on or off) that many I have seen using the IDE have chosen to set.
The issue is that while one file may use a header file from another, the header file does not really belong to that project.
In my case I am trying to patch somebody elses header file which is indirectly included (it is the implimentation of a template-class).
-- A better option than saving all of the files would be to save all dependancies.
Biplab:
--- Quote from: johnfemiani on September 03, 2007, 08:19:58 am ---The issue is that while one file may use a header file from another, the header file does not really belong to that project.
In my case I am trying to patch somebody elses header file which is indirectly included (it is the implimentation of a template-class).
-- A better option than saving all of the files would be to save all dependancies.
--- End quote ---
The issue could be further complicated. Let's say the included header structure is -
--- Quote ---foo.h
|_ foo1.h
|_ foo2.h
|_ foo3.h
--- End quote ---
In this case let's assume that you've included foo.h. So if you edit foo3.h (which is not part of the project) how C::B would determine that you've edited that or not without parsing the header interdependencies??
Please note that C::B supports multiple compiler and it's not easy to get a parsed output from all the supported compilers.
Rather a better option would be to add foo3.h to your project which will allow C::B to monitor and save it.
--- Quote from: johnfemiani on September 03, 2007, 08:19:58 am ----- A better option than saving all of the files would be to save all dependancies.
--- End quote ---
Add the required header to project. The header will be treated as a dependency.
johnfemiani:
That is exactly the scenario that I faced; and while the solution you suggest is less-than-elegant it is the one I am choosing to use.
Nevertheless the behavior I suggested is the one that I expected; and the one that the initial poster probably expected as well.
It seems that the developer response is:
" C::B does not and will not support an option to autosave ALL files on build, and will not support autosaving all DEPENDANT files on build because dependancy tracking is too complex when multiple compilers are in use, and there is a simple workaround by including dependant files in the project."
This is reasonable to me and all of my questions are answered; I did not understand the initial response because I thought "ALL" meant every modified file, but Pecan meant only all modified files in the project.
Cheers,
John
thomas:
You see, Code::Blocks saves all files in a project at build because that makes sense.
--- Quote from: johnfemiani on September 03, 2007, 07:55:40 am ---Visual studio saves ALL modified files
--- End quote ---
Yes, but this is plain stupid (not from your part, but from VS). You may have grown to this behaviour because you have been "taught" that this is how it should be by using Visual Studio, but that doesn't make it right.
If something doesn't belong to a project, it should not be affected by a project-related action. Software should never do such things as modifying "random" files behind your back, this is really, really bad, it can lead to desastrous results.
--- Quote ---But AutoSave saves all files
--- End quote ---
This, too, makes sense. The purpose of AutoSave is not to save files. The purpose of AutoSave is to create regular save points of everything you have been working on in case your computer crashes or you lose power, etc. So if you have been working for 6 hours without saving, you will be able to recover that work from the automatic save points.
Of course you might have modified something and never intended to save it, and the application has no way of knowing this. Therefore, AutoSave saves to a backup file and won't touch the original (unless you tell it otherwise).
Thus, you will have both the last saved and the last auto-saved versions of each file in case of a failure.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version