From 7d6d9f540de3f0c37a7d0c130a55b2e172518a7f Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sun, 18 Aug 2019 02:22:52 +0200 Subject: caja-progress-info: use NotifyNotification instead of GNotification Fixes https://github.com/mate-desktop/caja/issues/1285 --- libcaja-private/caja-progress-info.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index bc4e2a08..56f5f3f8 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -24,12 +24,14 @@ #include #include +#include + +#include #include #include #include #include "caja-progress-info.h" #include "caja-global-preferences.h" -#include enum { @@ -596,18 +598,8 @@ update_status_icon_and_window (void) { char *tooltip; gboolean toshow; - GIcon *icon; - GNotification *notification; - gboolean show_notifications = g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS); static gboolean window_shown = FALSE; - if (show_notifications) - { - notification = g_notification_new ("caja"); - icon = g_themed_icon_new ("system-file-manager"); - g_notification_set_icon (notification, icon); - } - tooltip = g_strdup_printf (ngettext ("%'d file operation active", "%'d file operations active", n_progress_ops), @@ -624,10 +616,18 @@ update_status_icon_and_window (void) if (window_shown) { - if (show_notifications && !gtk_window_is_active (GTK_WINDOW (get_progress_window ()))) + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS) && + !gtk_window_is_active (GTK_WINDOW (get_progress_window ()))) { - g_notification_set_body (notification, _("Process completed")); - g_application_send_notification (g_application_get_default (), "caja", notification); + NotifyNotification *notification; + + notification = notify_notification_new ("caja", + _("Process completed"), + "system-file-manager"); + + notify_notification_show (notification, NULL); + + g_object_unref (notification); } gtk_widget_hide (get_progress_window ()); -- cgit v1.2.1