aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-module.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-05 12:12:09 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-05 12:12:09 +0800
commit6d1aea1b231c120441061c2046157b40e34f8e3a (patch)
treee28bb0e3ea779b19b6d838a3a989ba57aba6324a /shell/e-shell-module.c
parent2c71859895d091f51dea23f9ed9552a0962b7ba4 (diff)
downloadgsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.tar.gz
gsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.tar.zst
gsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.zip
Support migration in the new shell design.
Some code got duplicated for calendars and tasks. Made a note to revisit. svn path=/branches/kill-bonobo/; revision=36560
Diffstat (limited to 'shell/e-shell-module.c')
-rw-r--r--shell/e-shell-module.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/shell/e-shell-module.c b/shell/e-shell-module.c
index 1eea8188b6..64d5efc41e 100644
--- a/shell/e-shell-module.c
+++ b/shell/e-shell-module.c
@@ -499,6 +499,40 @@ e_shell_module_shutdown (EShellModule *shell_module)
}
/**
+ * e_shell_migrate:
+ * @shell_module: an #EShellModule
+ * @major: major part of version to migrate from
+ * @minor: minor part of version to migrate from
+ * @micro: micro part of version to migrate from
+ * @error: return location for a #GError, or %NULL
+ *
+ * Attempts to migrate data and settings from version %major.%minor.%micro.
+ * Returns %TRUE if the migration was successful or if no action was
+ * necessary. Returns %FALSE and sets %error if the migration failed.
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise
+ **/
+gboolean
+e_shell_module_migrate (EShellModule *shell_module,
+ gint major,
+ gint minor,
+ gint micro,
+ GError **error)
+{
+ EShellModuleInfo *module_info;
+
+ g_return_val_if_fail (E_IS_SHELL_MODULE (shell_module), TRUE);
+
+ module_info = &shell_module->priv->info;
+
+ if (module_info->migrate != NULL)
+ return module_info->migrate (
+ shell_module, major, minor, micro, error);
+
+ return TRUE;
+}
+
+/**
* e_shell_module_set_info:
* @shell_module: an #EShellModule
* @info: an #EShellModuleInfo
@@ -535,6 +569,7 @@ e_shell_module_set_info (EShellModule *shell_module,
module_info->is_busy = info->is_busy;
module_info->shutdown = info->shutdown;
+ module_info->migrate = info->migrate;
/* Determine the user data directory for this module. */
g_free (shell_module->priv->data_dir);