[gnome-utils/gsettings-tutorial: 18/22] [gsettings-tutorial] Use macros to define the schema ids
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils/gsettings-tutorial: 18/22] [gsettings-tutorial] Use macros to define the schema ids
- Date: Sat, 17 Apr 2010 00:08:24 +0000 (UTC)
commit ed09eb3ba52368bff1a9377ecb363ace7fd89c6c
Author: Vincent Untz <vuntz gnome org>
Date: Fri Apr 16 18:54:22 2010 -0400
[gsettings-tutorial] Use macros to define the schema ids
This should probably have been done earlier in the tutorial ;-)
baobab/src/baobab-prefs.c | 4 ++--
baobab/src/baobab.c | 4 ++--
baobab/src/baobab.h | 3 +++
3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/baobab/src/baobab-prefs.c b/baobab/src/baobab-prefs.c
index 0a6c701..0f99194 100644
--- a/baobab/src/baobab-prefs.c
+++ b/baobab/src/baobab-prefs.c
@@ -67,7 +67,7 @@ filechooser_response_cb (GtkDialog *dialog,
if (props_changed) {
GSettings *settings_properties;
- settings_properties = g_settings_new ("org.gnome.baobab.properties");
+ settings_properties = g_settings_new (BAOBAB_SCHEMA_PROPERTIES);
save_skip_can_uri (settings_properties);
g_object_unref (settings_properties);
}
@@ -109,7 +109,7 @@ create_props (void)
fill_props_model (dlg);
check_enablehome = GTK_WIDGET (gtk_builder_get_object (builder, "check_enable_home"));
- settings_properties = g_settings_new ("org.gnome.baobab.properties");
+ settings_properties = g_settings_new (BAOBAB_SCHEMA_PROPERTIES);
update_skip_scan_uri (settings_properties);
g_settings_bind (settings_properties, "enable_home_monitor",
check_enablehome, "active",
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 78fda1b..4f71a51 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -819,8 +819,8 @@ baobab_init (void)
monitor_volume ();
/* GSettings */
- baobab.settings_ui = g_settings_new ("org.gnome.baobab.ui");
- baobab.settings_properties = g_settings_new ("org.gnome.baobab.properties");
+ baobab.settings_ui = g_settings_new (BAOBAB_SCHEMA_UI);
+ baobab.settings_properties = g_settings_new (BAOBAB_SCHEMA_PROPERTIES);
g_settings_bind (baobab.settings_ui, BAOBAB_TOOLBAR_VISIBLE_KEY,
baobab.toolbar, "visible",
diff --git a/baobab/src/baobab.h b/baobab/src/baobab.h
index f4c6f28..2e72736 100644
--- a/baobab/src/baobab.h
+++ b/baobab/src/baobab.h
@@ -39,6 +39,9 @@ struct BaobabSearchOpt;
#define BAOBAB_UI_FILE PKGDATADIR "/baobab-main-window.ui"
#define BAOBAB_DIALOG_SCAN_UI_FILE PKGDATADIR "/baobab-dialog-scan-props.ui"
+#define BAOBAB_SCHEMA "org.gnome.baobab"
+#define BAOBAB_SCHEMA_PROPERTIES BAOBAB_SCHEMA ".properties"
+#define BAOBAB_SCHEMA_UI BAOBAB_SCHEMA ".ui"
#define BAOBAB_TOOLBAR_VISIBLE_KEY "toolbar_visible"
#define BAOBAB_STATUSBAR_VISIBLE_KEY "statusbar_visible"
#define BAOBAB_SUBFLSTIPS_VISIBLE_KEY "baobab_subfoldertips_visible"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]