nautilus/nautilus-bsc979947.patch
Bjørn Lie 4ed501ed31 Accepting request 403761 from home:mgorse:branches:GNOME:Factory
- Add nautilus-bsc979947.patch: only write zoom level to user
  config if the user has adjusted it (bsc#979947).

OBS-URL: https://build.opensuse.org/request/show/403761
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/nautilus?expand=0&rev=248
2016-06-20 20:36:09 +00:00

60 lines
2.4 KiB
Diff

From 58661010db2237c69ad98ee446f20a16ba24888f Mon Sep 17 00:00:00 2001
From: Mike Gorse <mgorse@suse.com>
Date: Mon, 20 Jun 2016 11:31:26 -0500
Subject: [PATCH] Only save zoom level if the user has updated it
Don't write the zoom level to gsettings if the user has not made a
change from the system default. This allows an update to be installed
and then rolled back without a system default from the update having
been written to the user's configuration.
https://bugzilla.gnome.org/show_bug.cgi?id=767878
---
src/nautilus-canvas-view.c | 9 ++++++---
src/nautilus-list-view.c | 9 ++++++---
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 2c99ce7..b42a545 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -962,9 +962,12 @@ action_zoom_to_level (GSimpleAction *action,
nautilus_canvas_view_zoom_to_level (view, zoom_level);
g_simple_action_set_state (G_SIMPLE_ACTION (action), state);
- g_settings_set_enum (nautilus_icon_view_preferences,
- NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- zoom_level);
+ if (g_settings_get_enum (nautilus_icon_view_preferences,
+ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL) != zoom_level) {
+ g_settings_set_enum (nautilus_icon_view_preferences,
+ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ zoom_level);
+ }
}
static void
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 1c2f996..6237b21 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2507,9 +2507,12 @@ action_zoom_to_level (GSimpleAction *action,
nautilus_list_view_zoom_to_level (view, zoom_level);
g_simple_action_set_state (G_SIMPLE_ACTION (action), state);
- g_settings_set_enum (nautilus_list_view_preferences,
- NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
- zoom_level);
+ if (g_settings_get_enum (nautilus_list_view_preferences,
+ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL) != zoom_level) {
+ g_settings_set_enum (nautilus_list_view_preferences,
+ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
+ zoom_level);
+ }
}
static void
--
2.6.2