[gnome-calendar] shell-search: impl activate result



commit 16f6d28ac6cc977f9a32b0c71172b72cb9afbe42
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Feb 5 14:24:23 2015 -0500

    shell-search: impl activate result

 src/gcal-shell-search-provider.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-shell-search-provider.c b/src/gcal-shell-search-provider.c
index 402d034..c165ab2 100644
--- a/src/gcal-shell-search-provider.c
+++ b/src/gcal-shell-search-provider.c
@@ -19,6 +19,7 @@
 #include "gcal-shell-search-provider.h"
 #include "gcal-shell-search-provider-generated.h"
 
+#include "gcal-application.h"
 #include "gcal-utils.h"
 
 typedef struct
@@ -242,6 +243,25 @@ activate_result_cb (GcalShellSearchProvider  *search_provider,
                     guint32                   timestamp,
                     GcalShellSearchProvider2 *skel)
 {
+  GcalShellSearchProviderPrivate *priv;
+  GApplication *application;
+  GcalEventData *data;
+  ECalComponentDateTime dtstart;
+
+  priv = search_provider->priv;
+  application = g_application_get_default ();
+
+  data = gcal_manager_get_event_from_shell_search (priv->manager, result);
+  e_cal_component_get_dtstart (data->event_component, &dtstart);
+
+  gcal_application_set_uuid (GCAL_APPLICATION (application), result);
+  gcal_application_set_initial_date (GCAL_APPLICATION (application), dtstart.value);
+  e_cal_component_free_datetime (&dtstart);
+
+  g_application_activate (application);
+
+  g_object_unref (data->event_component);
+  g_free (data);
   return TRUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]