From 53d7285207b12cc898bfa0c95875cc7fd15ada69 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Thu, 11 Jan 2024 02:34:20 -0500 Subject: wayland-background-dialog: fix two issues found by cppcheck *Reduce the scope of the preview box *Do not read the same value from gsettings before reading it from the color style combobox --- src/file-manager/fm-desktop-wayland-bg-dialog.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/file-manager') diff --git a/src/file-manager/fm-desktop-wayland-bg-dialog.c b/src/file-manager/fm-desktop-wayland-bg-dialog.c index 84d0de35..89ecbb05 100644 --- a/src/file-manager/fm-desktop-wayland-bg-dialog.c +++ b/src/file-manager/fm-desktop-wayland-bg-dialog.c @@ -57,7 +57,6 @@ static void update_preview (gboolean starting, GtkWidget *box, const gchar *filename, const gchar *shading_type, const gchar *primary_color_str, const gchar *secondary_color_str) { - static GtkWidget *preview; static GtkWidget *preview_image; static GtkCssProvider *provider; gchar *css; @@ -67,6 +66,8 @@ update_preview (gboolean starting, GtkWidget *box, const gchar *filename, /* setup the preview only once*/ if (starting == TRUE) { + static GtkWidget *preview; + /*Get the size and shape of the desktop*/ GdkDisplay *display = gdk_screen_get_display (gdk_screen_get_default()); GdkMonitor *monitor = gdk_display_get_monitor (display, 0); @@ -206,8 +207,6 @@ static void update_color_background_options (GtkWidget *colorbox) { const gchar *shading_type, *primary_color_str, *secondary_color_str; - shading_type = g_settings_get_string (background_settings, - "color-shading-type"); primary_color_str = g_settings_get_string (background_settings, "primary-color"); -- cgit v1.2.1