[gnote] Cache gnome desktop interface schema to separate variable



commit 8b36481b7db7f37f5226938bed1fa362b6b0643e
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Dec 12 21:04:24 2020 +0200

    Cache gnome desktop interface schema to separate variable

 src/preferences.cpp | 3 ++-
 src/preferences.hpp | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/preferences.cpp b/src/preferences.cpp
index b7091299..6fbc317b 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2015,2017,2019 Aurimas Cernius
+ * Copyright (C) 2011-2015,2017,2019-2020 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -89,6 +89,7 @@ namespace gnote {
   {
     m_schemas[SCHEMA_GNOTE] = Gio::Settings::create(SCHEMA_GNOTE);
     m_schemas[SCHEMA_KEYBINDINGS] = Gio::Settings::create(SCHEMA_KEYBINDINGS);
+    m_schema_gnome_interface = Gio::Settings::create(SCHEMA_DESKTOP_GNOME_INTERFACE);
   }
   
   Glib::RefPtr<Gio::Settings> Preferences::get_schema_settings(const Glib::ustring & schema)
diff --git a/src/preferences.hpp b/src/preferences.hpp
index 8979dfc7..16c62e6b 100644
--- a/src/preferences.hpp
+++ b/src/preferences.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2015,2017,2019 Aurimas Cernius
+ * Copyright (C) 2011-2015,2017,2019-2020 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -94,9 +94,14 @@ namespace gnote {
     void init();
 
     Glib::RefPtr<Gio::Settings> get_schema_settings(const Glib::ustring & schema);
+    const Glib::RefPtr<Gio::Settings> & schema_gnome_interface() const
+      {
+        return m_schema_gnome_interface;
+      }
   private:
-    Preferences(const Preferences &); // non implemented
+    Preferences(const Preferences &) = delete;
     std::map<Glib::ustring, Glib::RefPtr<Gio::Settings> > m_schemas;
+    Glib::RefPtr<Gio::Settings> m_schema_gnome_interface;
   };
 
 


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