Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Autosave enhancement
Bat:
--- Quote ---I still don't understand. What you want is C::B to automatically copy the file from .save to the original on the next start?
--- End quote ---
Yes but not "silently". When something (workspace/project/editor) is opened, if a .save file exists, it warn user that an autosaved file exist and ask if it should be used or not. This type of feature is present on some other editors, code or generalist (I agree mainly Microsoft ones ...).
--- Quote ---This patch adds tons of complexity to the code, so you'll have to justify it, before it goes in SVN.
--- End quote ---
Yes, I've opened this topic to share about it because I know it add lot of things/breaks in sdk
Perharps at end of discussion, it's concluded it's not good idea ...
--- Quote ---The main objective is, however, that Code::Blocks does not crash in the first place, and we're reasonably close to that objective (I've not seen a crash on my machine for years).
--- End quote ---
I'm totally agree with objective. But in my usage for 2 years, I found some random crashes or "hangs" that lead to some losts. I'm convinced that some (and even all) are plugins related. If there is no problem, it don't change at all usage of C::B
--- Quote ---Having to restore from a save file is something that should rarely happen if ever (I remember having to do it a single time, years ago). It is not something most people will regularly find useful being automated.
--- End quote ---
The goal is clearly that this plugin never have work to do. It's like all bug reporting feature.
If poeple know which file should be restored it's ok.
Files poeple are mainly working on are obvious
A minor modification (comment one line) done one hour ago can easily not recover.
A change in project compilation flag can also be forgoten, as one hour after I don't remember that I have ad this DEFINE that enable a small minor change ...
For me it's the most important part, warning that an autosaved file exist for what we open.
Precision : I'm (also) an embedded developper (quite small chips) and it's a part of my usage. There are more projects options (related to compiler option) tweeking in this usage
So patch permit also to load this autosaved one "in place" of original, aka : get things back just before previous crash. File on disk is always original. In memory we have modified one. And at this point user can do what he would do (save, throw away). I've done it because I found this useful, be it can be a bad idea
--- Quote ---The code alters the SDK to make the plugin work with its new functionality, and the "complete save" feature uses a boolean as a lock.
--- End quote ---
Which one do you refer ? As far as I know, I add boolean for "workspace is load", I do that because there is only one workspace loaded at a time ?
I add a boolean in each editor instance and each project instance to says "this file is a recovered copy", because I haven't find any solution for saying "this file is the same as loaded from disk - from .save one, but it really a modified file - so if we close it we should ask if it must be save - to original one".
But I'm new to this part of C::B code so I can have missed lot of things !
oBFusCATed:
Maybe I'm baised, but I don't see a need for this feature.
I'm using autosave in save-to-original file mode and I think that the mode where the file is saved with another name is useless and should be removed.
The reason is that with my workflow - I don't want to restore the version from 5 minutes ago, I want the last version just before the crash.
CB saves your source code before compilation, so the original file might have new content relative to the .save file.
I don't want to compare the two versions and then choose which I want to keep. I always know that my latest work is on the disk in the original file.
If I want older revision I use my VCS to go back to it. With the modern DVCS-es you're free to commit whenever you like without possibility for breaking something for other people.
Bat:
This patch don't modify "save to original" mode. It just modify save to .save and save to .save (logrotate)
New version of patch :
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=3524&group_id=5358
-correction of _(" => _T(" where needed
-correction of one test missing to impact only ".save" and ".save" (logrotate)
For coupling between Autosave and cbEditor, I've searched, but I should miss something. If I delete autosave.dll C::B start correctly (no error), without autosave feature (seem obvious). If I disable autosave plugin, same behaviour. Could you point me an example of the coupling ?
[Note : if I disable and enable in same session of C::B neither plugin, there is an error as "xxx.zip" is already in VFS]
oBFusCATed:
--- Quote from: Bat on November 16, 2013, 07:17:19 pm ---Could you point me an example of the coupling ?
--- End quote ---
You're adding code and APIs in cbEditor which are only usable by this feature of the autosave plugin.
Folco:
As far as I remember, AutoCAD works like that : in case of crash, it shows you a dialog to recover files that were opened and not saved when the last crash occured.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version