[gnome-calendar/gbsneto/open-files: 3/6] manager: Ensure default calendar property is always set




commit e90c67a57d7c7d9120f5a2856adc4f10d4decc3f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Aug 16 15:26:59 2021 -0300

    manager: Ensure default calendar property is always set

 src/core/gcal-manager.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/core/gcal-manager.c b/src/core/gcal-manager.c
index 626cbf77..4ac01213 100644
--- a/src/core/gcal-manager.c
+++ b/src/core/gcal-manager.c
@@ -187,6 +187,7 @@ on_calendar_created_cb (GObject      *source_object,
                         GAsyncResult *result,
                         gpointer      user_data)
 {
+  g_autoptr (ESource) default_source = NULL;
   g_autoptr (GError) error = NULL;
   ESourceRefresh *refresh_extension;
   ESourceOffline *offline_extension;
@@ -246,6 +247,10 @@ on_calendar_created_cb (GObject      *source_object,
                                    NULL);
 
   g_signal_emit (self, signals[CALENDAR_ADDED], 0, calendar);
+
+  default_source = e_source_registry_ref_default_calendar (self->source_registry);
+  if (default_source == source)
+    g_object_notify (G_OBJECT (self->source_registry), "default-calendar");
 }
 
 static void


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