From b9744dd3fcc549b070ce385a11ede718905a5e1e Mon Sep 17 00:00:00 2001 From: lenemter Date: Sat, 16 Sep 2023 13:52:19 +0900 Subject: [PATCH] Rename to `gnome_background_settings` --- src/Background/Background.vala | 2 +- src/Background/BackgroundSource.vala | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Background/Background.vala b/src/Background/Background.vala index 4ddb2bc5..5c6e5cb7 100644 --- a/src/Background/Background.vala +++ b/src/Background/Background.vala @@ -105,7 +105,7 @@ namespace Gala { private void load_pattern () { string color_string; - var settings = background_source.settings; + var settings = background_source.gnome_background_settings; color_string = settings.get_string ("primary-color"); var color = Clutter.Color.from_string (color_string); diff --git a/src/Background/BackgroundSource.vala b/src/Background/BackgroundSource.vala index f9829bc5..9c51ceee 100644 --- a/src/Background/BackgroundSource.vala +++ b/src/Background/BackgroundSource.vala @@ -31,7 +31,7 @@ namespace Gala { public signal void changed (); public Meta.Display display { get; construct; } - public Settings settings { get; construct; } + public GLib.Settings gnome_background_settings { get; construct; } internal int use_count { get; set; default = 0; } @@ -50,19 +50,19 @@ namespace Gala { monitor_manager = display.get_context ().get_backend ().get_monitor_manager (); monitor_manager.monitors_changed.connect (monitors_changed); - settings = new Settings ("org.gnome.desktop.background"); + gnome_background_settings = new Settings ("org.gnome.desktop.background"); // unfortunately the settings sometimes tend to fire random changes even though // nothing actually happened. The code below is used to prevent us from spamming // new actors all the time, which lead to some problems in other areas of the code for (int i = 0; i < OPTIONS.length; i++) { - hash_cache[i] = settings.get_value (OPTIONS[i]).hash (); + hash_cache[i] = gnome_background_settings.get_value (OPTIONS[i]).hash (); } - settings.changed.connect ((key) => { + gnome_background_settings.changed.connect ((key) => { for (int i = 0; i < OPTIONS.length; i++) { if (key == OPTIONS[i]) { - uint new_hash = settings.get_value (key).hash (); + uint new_hash = gnome_background_settings.get_value (key).hash (); if (hash_cache[i] != new_hash) { hash_cache[i] = new_hash; changed (); @@ -95,7 +95,7 @@ namespace Gala { public Background get_background (int monitor_index) { string? filename = null; - var style = settings.get_enum ("picture-options"); + var style = gnome_background_settings.get_enum ("picture-options"); if (style != GDesktop.BackgroundStyle.NONE) { filename = get_background_path (); } @@ -119,14 +119,14 @@ namespace Gala { private string get_background_path () { if (Granite.Settings.get_default ().prefers_color_scheme == DARK) { - var uri = settings.get_string ("picture-uri-dark"); + var uri = gnome_background_settings.get_string ("picture-uri-dark"); var path = File.new_for_uri (uri).get_path (); if (FileUtils.test (path, EXISTS)) { return path; } } - var uri = settings.get_string ("picture-uri"); + var uri = gnome_background_settings.get_string ("picture-uri"); var path = File.new_for_uri (uri).get_path (); if (FileUtils.test (path, EXISTS)) { return path;