summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2024-01-11 02:34:20 -0500
committerLuke from DC <[email protected]>2024-01-17 00:33:59 +0000
commit53d7285207b12cc898bfa0c95875cc7fd15ada69 (patch)
treead06f8ac28ae09ab5ccf91258fc5ff7311dc970b
parentf885c9e0ab9384170417e3979b67f7fad5a186fc (diff)
downloadcaja-53d7285207b12cc898bfa0c95875cc7fd15ada69.tar.bz2
caja-53d7285207b12cc898bfa0c95875cc7fd15ada69.tar.xz
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
-rw-r--r--src/file-manager/fm-desktop-wayland-bg-dialog.c5
1 files changed, 2 insertions, 3 deletions
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");