[gedit] Use nautilus settings and fallback on a gedit nautilus schema if it doesn't exits.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use nautilus settings and fallback on a gedit nautilus schema if it doesn't exits.
- Date: Wed, 28 Jul 2010 15:47:03 +0000 (UTC)
commit dab0a24ccc78f2d9d98b4368d2c79c99e685bdec
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Jul 28 17:46:27 2010 +0200
Use nautilus settings and fallback on a gedit nautilus schema if it doesn't exits.
plugins/filebrowser/gedit-file-browser-plugin.c | 22 ++++++++++++++++++-
...ome.gedit.plugins.filebrowser.gschema.xml.in.in | 2 +-
2 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index d352f20..c461ae4 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -49,7 +49,8 @@
#define FILEBROWSER_FILTER_MODE "filter-mode"
#define FILEBROWSER_FILTER_PATTERN "filter-pattern"
-#define NAUTILUS_BASE_SETTINGS "org.gnome.Nautilus.preferences"
+#define NAUTILUS_BASE_SETTINGS "org.gnome.nautilus.preferences"
+#define NAUTILUS_FALLBACK_SETTINGS "org.gnome.gedit.plugins.filebrowser.nautilus"
#define NAUTILUS_CLICK_POLICY_KEY "click-policy"
#define NAUTILUS_ENABLE_DELETE_KEY "enable-delete"
#define NAUTILUS_CONFIRM_TRASH_KEY "confirm-trash"
@@ -133,11 +134,28 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (GeditFileBrowserPlugin,
static void
gedit_file_browser_plugin_init (GeditFileBrowserPlugin *plugin)
{
+ const gchar * const * schemas;
+
plugin->priv = GEDIT_FILE_BROWSER_PLUGIN_GET_PRIVATE (plugin);
plugin->priv->settings = g_settings_new (FILEBROWSER_BASE_SETTINGS);
- plugin->priv->nautilus_settings = g_settings_new (NAUTILUS_BASE_SETTINGS);
plugin->priv->terminal_settings = g_settings_new (TERMINAL_BASE_SETTINGS);
+
+ schemas = g_settings_list_schemas ();
+
+ for (; schemas != NULL && *schemas != NULL; schemas++)
+ {
+ if (g_strcmp0 (*schemas, NAUTILUS_BASE_SETTINGS) == 0)
+ {
+ plugin->priv->nautilus_settings = g_settings_new (NAUTILUS_BASE_SETTINGS);
+ break;
+ }
+ }
+
+ if (plugin->priv->nautilus_settings == NULL)
+ {
+ plugin->priv->nautilus_settings = g_settings_new (NAUTILUS_FALLBACK_SETTINGS);
+ }
}
static void
diff --git a/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in b/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
index 14af945..339e3ff 100644
--- a/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
+++ b/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
@@ -36,7 +36,7 @@
<_description>The filter pattern to filter the file browser with. This filter works on top of the filter_mode.</_description>
</key>
</schema>
- <schema id="org.gnome.Nautilus.preferences" path="/apps/nautilus/preferences/">
+ <schema id="org.gnome.gedit.plugins.filebrowser.nautilus" path="/apps/gedit/plugins/filebrowser/nautilus/">
<key name="click-policy" type="s">
<default>'double'</default>
</key>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]