Geary.Controller: Migrate release config if needed
If the current config directory is empty, go looking for config data in other well known locations and if found, copy it all across from the most recently modified directory. This supports migrating config from non-Flatpak to Flatpak locations, and release config to devel profile locations. Fixes #326
This commit is contained in:
parent
468ea6df58
commit
9658e9e3b4
3 changed files with 177 additions and 3 deletions
|
|
@ -858,6 +858,34 @@ public class Application.Client : Gtk.Application {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a set of paths of possible config locations.
|
||||
*
|
||||
* This is useful only for migrating configuration from
|
||||
* non-Flatpak to Flatpak or release-builds to non-release builds.
|
||||
*/
|
||||
internal GLib.File[] get_config_search_path() {
|
||||
var paths = new GLib.File[] {};
|
||||
var home = GLib.File.new_for_path(GLib.Environment.get_home_dir());
|
||||
paths += home.get_child(
|
||||
".config"
|
||||
).get_child(
|
||||
"geary"
|
||||
);
|
||||
paths += home.get_child(
|
||||
".var"
|
||||
).get_child(
|
||||
"app"
|
||||
).get_child(
|
||||
"org.gnome.Geary"
|
||||
).get_child(
|
||||
"config"
|
||||
).get_child(
|
||||
"geary"
|
||||
);
|
||||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays an error notification.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue