In the actual design, we spy every folder of the filesystem to check if there is a change. If there is a new file which is not in an excluded path, then we include it.
It is not intuitive for a user to have such a behaviour. If he checks only /home/foo and then created a new user bar, he will be surprised in the next backup to find both foo and bar datas.
See Gestion de la racine des sauvegardes (fr).
Because of that, we have to define a root directory of the profile. All files above this file will not be included in the save.
This task consists on doing the minimal change to accord with this design.
Another task will consists on having an optimal User Interface for that (different milestone).
In the examples below, we suppose we have an existing /home/foo/Documents directory.
The archi tag will now contain rootPath, the first directory to analyze and save:
~~~~ <archi rootPath="/home/foo"> <folder name="Documents" inclusion="true"/> </archi> ~~~~
The root of the save tag becomes the rootPath:
~~~~ <save version="0" date="2013-03-12T22:01:16"> <folder name="Documents"/> </save> ~~~~
Add the root directory in the constructor. Add its getter and setter.
Manage the new tag in archi
Before the creation of the profile, ask the user for the root path.
In the creation profile view, show the tree with the root path as root.
To prevent having some conflict between profile file and save files inside the archive, save files will be saved in a dedicated directory of the archive (save).
Directories located at a higher level than the root directory are not supposed to appear in the archive.
I.e. instead of having this list of file in the archive:
/home/foo/Documents/foo
/home/foo/Documents/bar
We should have:
save/foo
save/bar
<profile_name>_<version_number>.xml
[r69] | equincerot | 2013-03-19 22:57:46 +0100 (mar. 19 mars 2013) | 4 lignes
[tasks:#11] Profiles: manage root directory - Step 1
Refactor to change the root of all the trees used in the application.
Cleaner and smarter implementation of CheckableTreeModel/TreeItem. They are now showing the root item.
SaveProfile.h translation
Note: I didn't check the restore feature. We could have some minor regression.
Work still pending:
Related
Commit: [r69]
Tasks:
#11[r70] | equincerot | 2013-03-24 12:31:58 +0100 (dim. 24 mars 2013) | 6 lignes
[tasks:#11] Profiles: manage root directory - Step 1
New archive structure:
- files are saved with their relative path into the archive
- a new directory "save" contents all these saved files, instead of putting the files at the root of the archive (prevent conflicts)
- profile.xml is still at the root of the archive
Related
Commit: [r70]
Tasks:
#11[LOW] minor UI fix (the root has a weird vertical bar when expanded)
=> see Profiles: manage root directory - Step 2
Related
Tasks: #12
[r72] | equincerot | 2013-03-24 13:44:50 +0100 (dim. 24 mars 2013) | 2 lignes
[tasks:#11] Profiles: manage root directory - Step 1
Code clean
Related
Commit: [r72]
Tasks:
#11