[meld] Const-ify our application ID for consistency



commit 963a0ded7b9dac9a85279ddb9f6c59c56c251db1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Sep 30 11:59:25 2018 +1000

    Const-ify our application ID for consistency
    
    We're already most of the way to having org.gnome.meld be in consistent
    use for e.g., desktop files, schemas, etc. so let's make it official.

 meld/conf.py     | 2 ++
 meld/meldapp.py  | 7 ++++---
 meld/settings.py | 5 +----
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/meld/conf.py b/meld/conf.py
index 95e47eec..99de11c3 100644
--- a/meld/conf.py
+++ b/meld/conf.py
@@ -5,6 +5,8 @@ import sys
 __package__ = "meld"
 __version__ = "3.19.1"
 
+APPLICATION_ID = "org.gnome.meld"
+
 # START; these paths are clobbered on install by meld.build_helpers
 DATADIR = os.path.join(sys.prefix, "share", "meld")
 LOCALEDIR = os.path.join(sys.prefix, "share", "locale")
diff --git a/meld/meldapp.py b/meld/meldapp.py
index a997c2f7..d8015b2d 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -43,9 +43,10 @@ optparse._ = _
 class MeldApp(Gtk.Application):
 
     def __init__(self):
-        super().__init__()
-        self.set_flags(Gio.ApplicationFlags.HANDLES_COMMAND_LINE)
-        self.set_application_id("org.gnome.meld")
+        super().__init__(
+          application_id=meld.conf.APPLICATION_ID,
+          flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
+        )
         GLib.set_application_name("Meld")
         Gtk.Window.set_default_icon_name("meld")
 
diff --git a/meld/settings.py b/meld/settings.py
index 3d389b70..8b0c5dde 100644
--- a/meld/settings.py
+++ b/meld/settings.py
@@ -22,9 +22,6 @@ import meld.conf
 import meld.filters
 
 
-MELD_SCHEMA = 'org.gnome.meld'
-
-
 class MeldSettings(GObject.GObject):
     """Handler for settings that can't easily be bound to object properties"""
 
@@ -96,7 +93,7 @@ def load_settings_schema(schema_id):
 def create_settings():
     global settings, interface_settings, meldsettings
 
-    settings = load_settings_schema(MELD_SCHEMA)
+    settings = load_settings_schema(meld.conf.APPLICATION_ID)
     interface_settings = Gio.Settings.new('org.gnome.desktop.interface')
     meldsettings = MeldSettings()
 


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