aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-content.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-04 23:04:51 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-06 04:40:48 +0800
commit31b5261fdbe2c98e7f4f71e908e5d9b58609de94 (patch)
treee9157fa12b3978c68492b04c10137c74eee21b17 /modules/calendar/e-memo-shell-content.c
parent7d6027be1a9989549c80fdbe6dcf8317c54a6a6a (diff)
downloadgsoc2013-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-memo-shell-content.c')
-rw-r--r--modules/calendar/e-memo-shell-content.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index 3df2c424ee..ec97019f65 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -44,7 +44,6 @@ struct _EMemoShellContentPrivate {
GtkWidget *preview_pane;
ECalModel *memo_model;
- GalViewInstance *view_instance;
GtkOrientation orientation;
gchar *current_uid;
@@ -401,11 +400,6 @@ memo_shell_content_dispose (GObject *object)
priv->memo_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_memo_shell_content_parent_class)->dispose (object);
}
@@ -553,11 +547,9 @@ memo_shell_content_constructed (GObject *object)
view_instance, "display-view",
G_CALLBACK (memo_shell_content_display_view_cb),
object);
- priv->view_instance = view_instance;
-
- /* Do this last so e_memo_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. */
@@ -771,11 +763,3 @@ e_memo_shell_content_get_searchbar (EMemoShellContent *memo_shell_content)
return E_SHELL_SEARCHBAR (widget);
}
-GalViewInstance *
-e_memo_shell_content_get_view_instance (EMemoShellContent *memo_shell_content)
-{
- g_return_val_if_fail (
- E_IS_MEMO_SHELL_CONTENT (memo_shell_content), NULL);
-
- return memo_shell_content->priv->view_instance;
-}