diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-03-05 04:46:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-03 11:00:39 +0800 |
commit | 3e05d86173c12420db661fc80292252fe720b8d9 (patch) | |
tree | e34d31e2e36790957a4d8889aa5c25a49cad9538 /shell/e-shell.c | |
parent | c6b67831e8029d7c53a4c5b4057b19251cba6bb1 (diff) | |
download | gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar.gz gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar.bz2 gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar.lz gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar.xz gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.tar.zst gsoc2013-evolution-3e05d86173c12420db661fc80292252fe720b8d9.zip |
Adapt libeshell to the new ESource API.
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index bc252845cd..ae2641fac4 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -53,6 +53,7 @@ struct _EShellPrivate { GQueue alerts; EShellSettings *settings; + ESourceRegistry *registry; GActionGroup *action_group; GtkWidget *preferences_window; @@ -90,6 +91,7 @@ enum { PROP_MODULE_DIRECTORY, PROP_NETWORK_AVAILABLE, PROP_ONLINE, + PROP_REGISTRY, PROP_SHELL_SETTINGS }; @@ -683,6 +685,12 @@ shell_get_property (GObject *object, E_SHELL (object))); return; + case PROP_REGISTRY: + g_value_set_object ( + value, e_shell_get_registry ( + E_SHELL (object))); + return; + case PROP_SHELL_SETTINGS: g_value_set_object ( value, e_shell_get_shell_settings ( @@ -723,6 +731,11 @@ shell_dispose (GObject *object) priv->settings = NULL; } + if (priv->registry != NULL) { + g_object_unref (priv->registry); + priv->registry = NULL; + } + if (priv->action_group != NULL) { g_object_unref (priv->action_group); priv->action_group = NULL; @@ -857,10 +870,20 @@ shell_initable_init (GInitable *initable, GError **error) { GApplication *application = G_APPLICATION (initable); + EShellPrivate *priv; + + priv = E_SHELL_GET_PRIVATE (initable); shell_add_actions (application); - return g_application_register (application, cancellable, error); + priv->registry = e_source_registry_new_sync (cancellable, error); + if (priv->registry == NULL) + return FALSE; + + if (!g_application_register (application, cancellable, error)) + return FALSE; + + return TRUE; } static void @@ -1002,6 +1025,21 @@ e_shell_class_init (EShellClass *class) G_PARAM_CONSTRUCT)); /** + * EShell:registry + * + * The #ESourceRegistry manages #ESource instances. + **/ + g_object_class_install_property ( + object_class, + PROP_REGISTRY, + g_param_spec_object ( + "registry", + "Registry", + "Data source registry", + E_TYPE_SOURCE_REGISTRY, + G_PARAM_READABLE)); + + /** * EShell:settings * * The #EShellSettings object stores application settings. @@ -1397,6 +1435,22 @@ e_shell_get_shell_settings (EShell *shell) } /** + * e_shell_get_registry: + * @shell: an #EShell + * + * Returns the shell's #ESourceRegistry which holds all #ESource instances. + * + * Returns: the #ESourceRegistry + **/ +ESourceRegistry * +e_shell_get_registry (EShell *shell) +{ + g_return_val_if_fail (E_IS_SHELL (shell), NULL); + + return shell->priv->registry; +} + +/** * e_shell_create_shell_window: * @shell: an #EShell * @view_name: name of the initial shell view, or %NULL |