View Issue Details

IDProjectCategoryView StatusLast Update
0001665FreeCADFeaturepublic2017-09-03 15:47
Reportertriplus Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Summary0001665: Allow setting higher value for number of backup files
DescriptionCurrently 99 is the limit when the value is set from the preferences GUI. Setting the value manually in user.cfg file (FCInt Name="CountBackupFiles" Value="9999") worked as expected and therefore i am guessing input field in preferences GUI sets the limit to 2 digits but it could easily allow higher value to be set!
Steps To Reproduce1.) Open Preferences ... and open General settings Document tab.
2.) Value for Create up to backup files when resaving document limit is set to 99.
TagsNo tags attached.
FreeCAD Information

Relationships

related to 0001666 new Respect symbolic links 

Activities

yorik

2014-08-03 17:26

administrator   ~0004911

But would anybody really need more than 99 backup files??? Not to mention the extra time it would take when saving...

triplus

2014-08-03 18:00

developer   ~0004912

I can only speak for myself. A while back i started using macro Auto Save:

http://forum.freecadweb.org/viewtopic.php?f=22&t=5638

At first i had second thoughts how will this affect performance (frequent saving operation execution) but ATM i do not make HUGE assembly of parts therefore i do not notice any performance hit at all. Whatever happens while i model i never lost more work than the time interval i have set. This usually comes down to repeating last operation.

In my setup it is quite easy to get to 99 after few hours of work therefore if input field will not allow setting higher value i guess i will write a script for my own needs to swap user.cfg each time before FreeCAD starts because after each FreeCAD close value 99 gets set again.

On unrelated note if thumbnail saved in backup file would be a bit larger i was thinking for fun i could extract all thumbnails and put it together to see the whole history of development of part in timeline. A bit useless most of the time i know but nonetheless quite fun. Who knows in the future something like that could exist in FreeCAD to have history written inside original fcstd file as a set of diffs and in GUI user could navigate back/forward and preview any point in time the model was developed by looking at thumbnails and maybe to be able to add a note to each point in timeline.

yorik

2014-08-03 18:21

administrator   ~0004913

For me then it would be wiser to allow to save under another name ("Save a Copy"), then the macro could use that, and you woud be free to write as many autosave files as you want...

But I don't know, I'll wait for other opinions about this

triplus

2014-08-03 19:09

developer   ~0004914

How would that be different from (auto) saving the original file? Why shouldn't original file have more then 99 backup files if copy of it could have it?

First i thought maybe there is an limitation in the FreeCAD code and that is why 99 is the highest possible value but after setting FCInt Name="CountBackupFiles" Value="9999" manually in user.cfg file and starting FreeCAD backup files went over the number 99 without issues therefore i am guessing 99 limit in GUI is purely administrative barrier and not FreeCAD code technical limit. I could be wrong and it could brake after 999... i haven't tested that.

Anyway if it is purely administrative barrier i am guessing it would not take much hassle to make the limit higher and introducing another solution to over come this 99 limit is not needed.

Bottom line i would find it more elegant if FreeCAD would remove this administrative barrier and therefore requested this feature first (to have this ability by default). If this will for whatever reason not happen i guess i will go down the road to write a script and to swap user.cfg file before each FreeCAD start.

triplus

2014-08-03 20:05

developer   ~0004915

OK i found out i could change this value above 2 digits under:

Tools --> Edit parameters ... --> Preferences --> Document --> CountBackupFiles

As long as i don't make changes in Preferences GUI the setting will persist in user.cfg.

Ideally Preferences GUI will allow to set this value above 2 digits in the future.

yorik

2014-08-03 21:20

administrator   ~0004916

Well if it is just the matter of adjusting the UI widget, then I don't see why not indeed... But it continues to puzzle me how you can do anything useful in a folder containing 100 versions of a file :)

triplus

2014-08-03 22:01

developer   ~0004918

"But it continues to puzzle me how you can do anything useful in a folder containing 100 versions of a file :)"

Yes i wanted to open feature request in the past where user could define centralized folder for backups. Working file and backups would not mix at all. All backups would be saved to pre-set folder. I predicted this would probably not be implemented in foreseeable future and now when working on file i just crate folder for working file and that working file always stays at top in file manager end everything else are backups. For example there would be a need to solve issues like having two files with the same name at different location and both saving backups in the same folder. Maybe individual folders could be created by UUID inside that folder but AFAIK users can quickly produce 2 files at different location with the same UUID...

Before using Auto Save macro i would probably think the same but now when fail (lost data) rate due to "FreeCAD crashing" or "Force QUIT" is down to 0 and when creating new document FreeCAD asks me automatically to save the file... well now it's a bit funny and at the end of the day the longer the list of backups well i guess more work done. Motivation technique i guess for now and therefore 99 is just too low.

And yes i am still thinking to maybe extract thumbnails with a script and attach something like "watermark" (the name of the backup file) on top of it for fun. This would allow me to easily find point in time where i want to "start over" or better crate fork for project where you model something over longer periods of time and basically you have the whole history saved in backups.

triplus

2014-08-04 11:33

developer   ~0004919

I had an idea how to resolve this on system level. Simply creating symbolic link to file stored in different location/folder would allow the user to not mix working file and backups at the same locations instead symbolic links would be used.

But it looks like FreeCAD does not respect symbolic links ATM:

http://www.freecadweb.org/tracker/view.php?id=1666

I opened feature request and ideally in the future symbolic links will work as expected and Preferences GUI widget will allow more that 2 digits.

If none of this happens well it works good enough ATM for me and simply pushing the value up:

Tools --> Edit parameters ... --> Preferences --> Document --> CountBackupFiles

Enables me to do my work the way i want to. Potential issues like applying Preferences GUI settings and the need to push the CountBackupFiles value up again after that and large number of backup files in working directory are manageable.

triplus

2014-10-25 22:15

developer   ~0005253

The limit 0-99 comes down to being Qt defaults for SpinBox:

"The default maximum value is 99."

http://qt-project.org/doc/qt-4.8/qspinbox.html

Basically any SpinBox if not otherwise set will use this values by default:

Minimum: 0
Maximum: 99
Step: 1

Minimum value for backups files (1) is already set for "Create up to backup files when resaving document SpinBox" therefore maximum SpinBox value should be explicitly set for the widget to go above default maximum SpinBox value of 99:

<widget class="Gui::PrefSpinBox" name="prefCountBackupFiles">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>999999999</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>CountBackupFiles</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Document</cstring>
</property>

https://github.com/FreeCAD/FreeCAD_sf_master/blob/996af8d808a818726bd66c0e515e2d7eb7306bad/src/Gui/DlgSettingsDocument.ui

I used 999999999 in this example to set maximum SpinBox value because currently this is the maximum value for SpinBox user can set manually under:

Tools --> Edit parameters ... --> Preferences --> Document --> CountBackupFiles

On a side note it would probably make sense if under the same (Document) tab in Preferences SpinBox for Document save compression level would not accept values above 9 therefore:

<widget class="Gui::PrefSpinBox" name="prefCompression">
<property name="maximum">
<number>9</number>
</property>
<property name="value">
<number>3</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>CompressionLevel</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Document</cstring>
</property>
</widget>

Related Changesets

FreeCAD: master 9256de8c

2014-10-28 18:15:51

wmayer

Details Diff
+ fixes 0001665: Allow setting higher value for number of backup files Affected Issues
0001665
mod - src/Gui/DlgSettingsDocumentImp.cpp Diff File

Issue History

Date Modified Username Field Change
2014-08-03 15:50 triplus New Issue
2014-08-03 17:26 yorik Note Added: 0004911
2014-08-03 18:00 triplus Note Added: 0004912
2014-08-03 18:21 yorik Note Added: 0004913
2014-08-03 19:09 triplus Note Added: 0004914
2014-08-03 20:05 triplus Note Added: 0004915
2014-08-03 21:20 yorik Note Added: 0004916
2014-08-03 22:01 triplus Note Added: 0004918
2014-08-04 11:33 triplus Note Added: 0004919
2014-10-25 22:15 triplus Note Added: 0005253
2014-10-28 17:41 wmayer Changeset attached => FreeCAD Master master 9256de8c
2014-10-28 17:41 wmayer Assigned To => wmayer
2014-10-28 17:41 wmayer Status new => closed
2014-10-28 17:41 wmayer Resolution open => fixed
2017-09-03 15:47 Kunda1 Relationship added related to 0001666