diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-07-04 23:04:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-07-06 04:40:48 +0800 |
commit | 31b5261fdbe2c98e7f4f71e908e5d9b58609de94 (patch) | |
tree | e9157fa12b3978c68492b04c10137c74eee21b17 /modules/calendar/e-task-shell-content.c | |
parent | 7d6027be1a9989549c80fdbe6dcf8317c54a6a6a (diff) | |
download | gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.gz gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.bz2 gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.lz gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.xz gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.tar.zst gsoc2013-evolution-31b5261fdbe2c98e7f4f71e908e5d9b58609de94.zip |
EShellView: Add a "view-instance" property.
EShellView now holds a reference to the active GalViewInstance. Where
applicable, the EShellView subclass is responsible for keeping this up
to date when the sidebar selection changes.
Holding a reference allows EShellView to implement common actions like
"Save Current View" directly instead pushing it on to subclasses.
New functions:
e_shell_view_get_view_instance
e_shell_view_set_view_instance
Diffstat (limited to 'modules/calendar/e-task-shell-content.c')
-rw-r--r-- | modules/calendar/e-task-shell-content.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index c4fa849609..33c65081c4 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -43,7 +43,6 @@ struct _ETaskShellContentPrivate { GtkWidget *preview_pane; ECalModel *task_model; - GalViewInstance *view_instance; GtkOrientation orientation; gchar *current_uid; @@ -400,11 +399,6 @@ task_shell_content_dispose (GObject *object) priv->task_model = NULL; } - if (priv->view_instance != NULL) { - g_object_unref (priv->view_instance); - priv->view_instance = NULL; - } - /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (e_task_shell_content_parent_class)->dispose (object); } @@ -552,11 +546,9 @@ task_shell_content_constructed (GObject *object) view_instance, "display-view", G_CALLBACK (task_shell_content_display_view_cb), object); - priv->view_instance = view_instance; - - /* Do this last so e_task_shell_content_get_view_instance() returns - * the correct instance in GalViewInstance::loaded signal handlers. */ + e_shell_view_set_view_instance (shell_view, view_instance); gal_view_instance_load (view_instance); + g_object_unref (view_instance); /* Restore pane positions from the last session once * the shell view is fully initialized and visible. */ @@ -795,11 +787,3 @@ e_task_shell_content_get_searchbar (ETaskShellContent *task_shell_content) return E_SHELL_SEARCHBAR (widget); } -GalViewInstance * -e_task_shell_content_get_view_instance (ETaskShellContent *task_shell_content) -{ - g_return_val_if_fail ( - E_IS_TASK_SHELL_CONTENT (task_shell_content), NULL); - - return task_shell_content->priv->view_instance; -} |