After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 625761 - Folder views not preserved after migration
Folder views not preserved after migration
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.32.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[xdg-basedir]
Depends on:
Blocks:
 
 
Reported: 2010-08-01 14:04 UTC by Lucian Langa
Modified: 2013-09-13 01:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rename view filenames (3.04 KB, patch)
2010-08-01 14:07 UTC, Lucian Langa
accepted-commit_now Details | Review
fix view and config directory migration (3.67 KB, patch)
2010-08-02 10:00 UTC, Lucian Langa
committed Details | Review

Description Lucian Langa 2010-08-01 14:04:06 UTC
After moving to xdg base directories folder view settings are missing.
eg. no sort by date, no last mail message selected.
Comment 1 Lucian Langa 2010-08-01 14:07:44 UTC
Created attachment 166931 [details] [review]
rename view filenames

mail/views directory is not properly migrated. Views files encodes mail folder path in it's filename so we also need to properly rename those files when moving to the XDG directories. Otherwise the old files are useless and changing view settings will result in a new file created.

There are several ways to fix this however the simplest way is to replace old_base_dir with new_base_dir in filename while renaming.
Comment 2 Matthew Barnes 2010-08-01 14:42:04 UTC
Another good catch!  Please commit.
Comment 3 Lucian Langa 2010-08-02 10:00:51 UTC
Created attachment 166953 [details] [review]
fix view and config directory migration

I found more issues with my previous patch.

1. before rename, we have to test for old_base_dir in file name, we could have view files that does not necessarily have to contain old_basedir (eg. custom_view-nntp:__@server-folder.xml)
2. the same migration procedure applies for old mail/config directory regarding et-expanded-* files - since there is no point in opening another bug just for that, I updated my patch accordingly.
3. do not reallocate old_base_dir and new_base_dir over the while loop, free both after use.
4. also free contents of result string
Comment 4 Matthew Barnes 2010-08-02 23:51:36 UTC
I tweaked the patch a little bit, but the logic itself was correct.  Thanks again for this.  Committing it myself so it makes the release.

http://git.gnome.org/browse/evolution/commit/?id=e919c9724f612270053683ad110ffd68de135c60