[shotwell/wip/enhanced-profiles] Use a constant for the system profile



commit 942cb6a7fb9b77147d7a108f4300193f6ae97929
Author: Jens Georg <mail jensge org>
Date:   Sat Aug 13 14:08:19 2022 +0200

    Use a constant for the system profile

 src/ProfileBrowser.vala | 4 ++--
 src/Profiles.vala       | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/ProfileBrowser.vala b/src/ProfileBrowser.vala
index 4678bff3..565a2499 100644
--- a/src/ProfileBrowser.vala
+++ b/src/ProfileBrowser.vala
@@ -19,7 +19,7 @@ namespace Shotwell {
             list_box.row_activated.connect((list_box, row) => {
                 var index = row.get_index();
                 var profile = (Profile) ProfileManager.get_instance().get_item(index);
-                if (profile.id == "__shotwell_default_system") {
+                if (profile.id == Profile.SYSTEM) {
                     profile_activated(null);
                 } else {
                     profile_activated(profile.name);
@@ -83,7 +83,7 @@ namespace Shotwell {
 
             box.pack_start(a);
 
-            if (p.id != "__shotwell_default_system" && ! p.active) {
+            if (p.id != Profile.SYSTEM && ! p.active) {
                 var b = new Gtk.Button.from_icon_name("window-close-symbolic", Gtk.IconSize.BUTTON);
                 b.margin_top = 6;
                 b.margin_bottom = 6;
diff --git a/src/Profiles.vala b/src/Profiles.vala
index 52bf5802..392b40c8 100644
--- a/src/Profiles.vala
+++ b/src/Profiles.vala
@@ -6,6 +6,7 @@
 
 namespace Shotwell {
     class Profile : Object {
+        public const string SYSTEM = "__shotwell_default_system";
         public Profile(string name, string id, string data_dir, bool active) {
             Object(name: name, id: id, data_dir: data_dir, active: active);
         }
@@ -28,7 +29,7 @@ namespace Shotwell {
 
         GLib.Object? get_item (uint position) {
             if (position == 0) {
-                return new Profile(_("System Profile"), "__shotwell_default_system",
+                return new Profile(_("System Profile"), Profile.SYSTEM,
                             Path.build_path(Path.DIR_SEPARATOR_S, Environment.get_user_data_dir(), 
"shotwell"),
                             this.profile == null);
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]