[gnote] Port NoteWindow to new Preferences
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Port NoteWindow to new Preferences
- Date: Mon, 27 Jun 2011 09:20:08 +0000 (UTC)
commit 25c3c44e9fa06dfea722ef659346b68f00e61ed5
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Tue Jun 21 23:12:06 2011 +0300
Port NoteWindow to new Preferences
Adapt to new Preferences API with Gio::Settings.
src/notewindow.cpp | 11 +++++++----
src/notewindow.hpp | 1 -
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index ade748e..ba1e55c 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -128,10 +128,14 @@ namespace gnote {
// Don't set up Ctrl-W or Ctrl-N if Emacs is in use
bool using_emacs = false;
- std::string gtk_key_theme =
- Preferences::obj().get<std::string>("/desktop/gnome/interface/gtk_key_theme");
+ Glib::RefPtr<Gio::Settings> desktop_settings = Preferences::obj()
+ .get_or_load_schema_settings(Preferences::SCHEMA_DESKTOP_GNOME_INTERFACE);
+ if(desktop_settings) {
+ std::string gtk_key_theme =
+ desktop_settings->get_string(Preferences::DESKTOP_GNOME_KEY_THEME);
if (!gtk_key_theme.empty() && (gtk_key_theme == "Emacs"))
using_emacs = true;
+ }
// NOTE: Since some of our keybindings are only
// available in the context menu, and the context menu
@@ -200,7 +204,6 @@ namespace gnote {
m_mark_set_timeout = NULL;
// make sure editor is NULL. See bug 586084
m_editor = NULL;
- Preferences::obj().remove_notify(m_gconf_notify);
}
@@ -229,7 +232,7 @@ namespace gnote {
if (m_find_bar && m_find_bar->get_visible()) {
m_find_bar->hide();
}
- else if (Preferences::obj().get<bool>(
+ else if (Preferences::obj().get_schema_settings(Preferences::SCHEMA_GNOTE)->get_boolean(
Preferences::ENABLE_CLOSE_NOTE_ON_ESCAPE)) {
close_window_handler();
}
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index 24def7c..3016a55 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -173,7 +173,6 @@ private:
utils::GlobalKeybinder *m_global_keys;
utils::InterruptableTimeout *m_mark_set_timeout;
- guint m_gconf_notify;
};
class NoteFindBar
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]