From 3641bd709a12f0e75cee6edaa90881420d54455b Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Mon, 25 Mar 2019 23:03:56 +0100 Subject: caja-progress-info: make sure argument is initialized Fixes Clang static analyzer warning: caja-progress-info.c:626:17: warning: 1st function call argument is an uninitialized value g_notification_set_body (notification, _("Process completed")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- libcaja-private/caja-progress-info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libcaja-private') diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c index 39eb4b71..0023c65e 100644 --- a/libcaja-private/caja-progress-info.c +++ b/libcaja-private/caja-progress-info.c @@ -595,9 +595,10 @@ update_status_icon_and_window (void) 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 (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS)) + if (show_notifications) { notification = g_notification_new ("caja"); icon = g_themed_icon_new ("system-file-manager"); @@ -620,8 +621,7 @@ update_status_icon_and_window (void) if (window_shown) { - if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_SHOW_NOTIFICATIONS) && - !gtk_window_is_active (GTK_WINDOW (get_progress_window ()))) + if (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); -- cgit v1.2.1