[evolution-data-server/gnome-3-38] alarm-notify: Stop using g_application_register()



commit 902f9ca21b93ac14c16a5b423bd6b60bed8a6ecb
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 18 19:56:08 2021 +0100

    alarm-notify: Stop using g_application_register()
    
    It creates a runtime warning on the console when another instance
    is already running and it is not needed to be done, because
    the GApplication takes care of it on its own.
    
    Related to https://gitlab.gnome.org/GNOME/glib/-/issues/1857

 src/services/evolution-alarm-notify/e-alarm-notify.c       |  1 +
 .../evolution-alarm-notify/evolution-alarm-notify.c        | 14 --------------
 2 files changed, 1 insertion(+), 14 deletions(-)
---
diff --git a/src/services/evolution-alarm-notify/e-alarm-notify.c 
b/src/services/evolution-alarm-notify/e-alarm-notify.c
index 3c8053e71..1ba1eeb31 100644
--- a/src/services/evolution-alarm-notify/e-alarm-notify.c
+++ b/src/services/evolution-alarm-notify/e-alarm-notify.c
@@ -1242,5 +1242,6 @@ e_alarm_notify_new (GCancellable *cancellable,
        return g_initable_new (
                E_TYPE_ALARM_NOTIFY, cancellable, error,
                "application-id", APPLICATION_ID,
+               "flags", G_APPLICATION_ALLOW_REPLACEMENT,
                NULL);
 }
diff --git a/src/services/evolution-alarm-notify/evolution-alarm-notify.c 
b/src/services/evolution-alarm-notify/evolution-alarm-notify.c
index 3e9e68e62..5467a8d7b 100644
--- a/src/services/evolution-alarm-notify/evolution-alarm-notify.c
+++ b/src/services/evolution-alarm-notify/evolution-alarm-notify.c
@@ -77,20 +77,6 @@ main (gint argc,
                exit (EXIT_FAILURE);
        }
 
-       g_application_register (G_APPLICATION (alarm_notify), NULL, &error);
-
-       if (error != NULL) {
-               g_printerr ("%s\n", error->message);
-               g_error_free (error);
-               g_object_unref (alarm_notify);
-               exit (EXIT_FAILURE);
-       }
-
-       if (g_application_get_is_remote (G_APPLICATION (alarm_notify))) {
-               g_object_unref (alarm_notify);
-               return 0;
-       }
-
 #ifdef G_OS_UNIX
        g_unix_signal_add_full (
                G_PRIORITY_DEFAULT, SIGTERM,


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