From 5b4e7d470dc556faac4b09b6a1968f32c5917b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 18 Dec 2014 15:43:13 -0500 Subject: [PATCH] month-view: implement GcalView::get_by_uuid --- src/gcal-month-view.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index 62af3a84..207a2c19 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -1586,14 +1586,27 @@ gcal_month_view_get_right_header (GcalView *view) return g_strdup_printf ("%d", priv->date->year); } +/** + * gcal_month_view_get_by_uuid: + * @view: + * @uuid: + * + * This will always returns a master widget. + * + * Returns: + **/ static GtkWidget* gcal_month_view_get_by_uuid (GcalView *view, const gchar *uuid) { - /* FIXME: this method is deprecated in favor of remove_by_uuid, hide_by_uuid, etc */ - /* Since the view internally duplicates the widgets per uuid, doesn't have much sense to do this. */ - /* One possible way could be: retrieve always the master widget, and hook some handlers into */ - /* ::hide, ::delete, etc. etc. Not sure what's best tho. */ + GcalMonthViewPrivate *priv; + GList *l; + + priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (view)); + l = g_hash_table_lookup (priv->children, uuid); + if (l != NULL) + return (GtkWidget*) l->data; + return NULL; }