[gnome-calendar] window: update GcalManager:objects-added handler
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: update GcalManager:objects-added handler
- Date: Thu, 4 Dec 2014 22:34:08 +0000 (UTC)
commit 8ca256b130535764f7c75e4ed9b2e00c3fa525aa
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Sun Oct 5 19:14:18 2014 -0400
window: update GcalManager:objects-added handler
src/gcal-window.c | 44 ++++++++------------------------------------
1 files changed, 8 insertions(+), 36 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index e919203..1d93707 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1120,54 +1120,26 @@ gcal_window_events_added (GcalManager *manager,
GSList *l;
- gchar **tokens;
- gchar *source_uid;
- gchar *event_uid;
-
GcalView *view;
- GtkWidget *event;
- icaltimetype *start_date;
- icaltimetype *end_date;
+ GtkWidget *e;
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
view = GCAL_VIEW (priv->views[priv->active_view]);
for (l = events_list; l != NULL; l = l->next)
{
- tokens = g_strsplit ((gchar*) l->data, ":", 2);
- source_uid = tokens[0];
- event_uid = tokens[1];
- start_date = gcal_manager_get_event_start_date (manager,
- source_uid,
- event_uid);
- end_date = gcal_manager_get_event_end_date (manager,
- source_uid,
- event_uid);
-
- /* FIXME: erase me */
- /* g_debug ("add: %s with date %s", */
- /* (gchar*) l->data, */
- /* icaltime_as_ical_string (*start_date)); */
-
- if (gcal_view_draw_event (view, start_date, end_date) &&
- gcal_view_get_by_uuid (view, (gchar*)l->data) == NULL)
+ e = gcal_event_widget_new_from_data ((GcalEventData*) l->data);
+
+ if (gcal_view_will_add_event (view, GCAL_EVENT_WIDGET (e)))
{
- event = gcal_event_widget_new ((gchar*) l->data);
- gcal_window_update_event_widget (manager,
- source_uid,
- event_uid,
- GCAL_EVENT_WIDGET (event));
- gtk_widget_show (event);
- gtk_container_add (GTK_CONTAINER (view), event);
-
- g_signal_connect (event,
+ gtk_widget_show (e);
+ gtk_container_add (GTK_CONTAINER (view), e);
+
+ g_signal_connect (e,
"activate",
G_CALLBACK (gcal_window_event_activated),
user_data);
}
-
- g_free (start_date);
- g_strfreev (tokens);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]