[gnome-shell] calendar-server: Move method



commit e0a8cb565ec29881f6ab29abad032bfd36986e87
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jun 4 22:11:42 2020 +0200

    calendar-server: Move method
    
    We'll need to call it from app_update_views(), so move it up to make
    it available to that function without a prior declaration.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1300

 src/calendar-server/gnome-shell-calendar-server.c | 44 +++++++++++------------
 1 file changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/src/calendar-server/gnome-shell-calendar-server.c 
b/src/calendar-server/gnome-shell-calendar-server.c
index 8ee8d3f1c5..100b77b36b 100644
--- a/src/calendar-server/gnome-shell-calendar-server.c
+++ b/src/calendar-server/gnome-shell-calendar-server.c
@@ -695,6 +695,28 @@ app_stop_view (App *app,
       g_signal_handlers_disconnect_by_func (view, on_objects_removed, app);
 }
 
+static void
+app_notify_has_calendars (App *app)
+{
+  GVariantBuilder dict_builder;
+
+  g_variant_builder_init (&dict_builder, G_VARIANT_TYPE ("a{sv}"));
+  g_variant_builder_add (&dict_builder, "{sv}", "HasCalendars",
+                         g_variant_new_boolean (app_has_calendars (app)));
+
+  g_dbus_connection_emit_signal (app->connection,
+                                 NULL,
+                                 "/org/gnome/Shell/CalendarServer",
+                                 "org.freedesktop.DBus.Properties",
+                                 "PropertiesChanged",
+                                 g_variant_new ("(sa{sv}as)",
+                                                "org.gnome.Shell.CalendarServer",
+                                                &dict_builder,
+                                                NULL),
+                                 NULL);
+  g_variant_builder_clear (&dict_builder);
+}
+
 static void
 app_update_views (App *app)
 {
@@ -726,28 +748,6 @@ app_update_views (App *app)
   g_slist_free_full (clients, g_object_unref);
 }
 
-static void
-app_notify_has_calendars (App *app)
-{
-  GVariantBuilder dict_builder;
-
-  g_variant_builder_init (&dict_builder, G_VARIANT_TYPE ("a{sv}"));
-  g_variant_builder_add (&dict_builder, "{sv}", "HasCalendars",
-                         g_variant_new_boolean (app_has_calendars (app)));
-
-  g_dbus_connection_emit_signal (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL),
-                                 NULL,
-                                 "/org/gnome/Shell/CalendarServer",
-                                 "org.freedesktop.DBus.Properties",
-                                 "PropertiesChanged",
-                                 g_variant_new ("(sa{sv}as)",
-                                                "org.gnome.Shell.CalendarServer",
-                                                &dict_builder,
-                                                NULL),
-                                 NULL);
-  g_variant_builder_clear (&dict_builder);
-}
-
 static void
 on_client_appeared_cb (CalendarSources *sources,
                        ECalClient *client,


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