summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-progress-info.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-25 23:03:56 +0100
committerraveit65 <[email protected]>2019-04-22 21:58:19 +0200
commitb9f782253a4ad705d00197ff59b7f45d5dc8c530 (patch)
treeab48d6a5a946c9f79edadcf5806d3b610e17cd4f /libcaja-private/caja-progress-info.c
parent79be18ef14cdf3404b96af1e8355648b5c0b3beb (diff)
downloadcaja-b9f782253a4ad705d00197ff59b7f45d5dc8c530.tar.bz2
caja-b9f782253a4ad705d00197ff59b7f45d5dc8c530.tar.xz
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")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'libcaja-private/caja-progress-info.c')
-rw-r--r--libcaja-private/caja-progress-info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcaja-private/caja-progress-info.c b/libcaja-private/caja-progress-info.c
index 4e331f1c..bc4e2a08 100644
--- a/libcaja-private/caja-progress-info.c
+++ b/libcaja-private/caja-progress-info.c
@@ -598,9 +598,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");
@@ -623,8 +624,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);