static gboolean
activate_result_cb (GcalShellSearchProvider  *search_provider,
                    GDBusMethodInvocation    *invocation,
                    gchar                    *result,
                    gchar                   **terms,
                    guint32                   timestamp,
                    GcalShellSearchProvider2 *skel)
{
  GcalShellSearchProviderPrivate *priv;
  GApplication *application;
  GcalEvent *event;
  GDateTime *dtstart;

  priv = search_provider->priv;
  application = g_application_get_default ();

  event = gcal_manager_get_event_from_shell_search (priv->manager, result);
  dtstart = gcal_event_get_date_start (event);

  gcal_application_set_uuid (GCAL_APPLICATION (application), result);
  gcal_application_set_initial_date (GCAL_APPLICATION (application), dtstart);

  g_application_activate (application);

  g_clear_object (&event);

  return TRUE;
}
static gboolean
activate_result_cb (GcalShellSearchProvider  *search_provider,
                    GDBusMethodInvocation    *invocation,
                    gchar                    *result,
                    gchar                   **terms,
                    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);
  if (dtstart.tzid != NULL)
    dtstart.value->zone = icaltimezone_get_builtin_timezone_from_tzid (dtstart.tzid);

  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;
}