[gedit] Bind the filter-pattern property with the settings equivalent.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Bind the filter-pattern property with the settings equivalent.
- Date: Fri, 2 Jul 2010 18:06:30 +0000 (UTC)
commit a84d70c37e5e5f2064c65c14dc9bbc0808f8cf91
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Fri Jul 2 20:06:04 2010 +0200
Bind the filter-pattern property with the settings equivalent.
plugins/filebrowser/gedit-file-browser-plugin.c | 61 +++--------------------
1 files changed, 7 insertions(+), 54 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index c8a7c26..6de55ce 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -99,9 +99,6 @@ static void on_rename_cb (GeditFileBrowserStore *model,
GFile *oldfile,
GFile *newfile,
GeditWindow *window);
-static void on_filter_pattern_changed_cb (GeditFileBrowserWidget *widget,
- GParamSpec *param,
- GeditFileBrowserPlugin *plugin);
static void on_tab_added_cb (GeditWindow *window,
GeditTab *tab,
GeditFileBrowserPlugin *plugin);
@@ -258,21 +255,6 @@ restore_default_location (GeditFileBrowserPlugin *plugin)
g_free (virtual_root);
}
-static void
-restore_filter (GeditFileBrowserPlugin *plugin)
-{
- GeditFileBrowserPluginPrivate *priv = plugin->priv;
- gchar *pattern;
-
- pattern = g_settings_get_string (priv->settings,
- FILEBROWSER_FILTER_PATTERN);
-
- gedit_file_browser_widget_set_filter_pattern (priv->tree_widget,
- pattern);
-
- g_free (pattern);
-}
-
static GeditFileBrowserViewClickPolicy
click_policy_from_string (gchar const *click_policy)
{
@@ -626,11 +608,6 @@ gedit_file_browser_plugin_activate (GeditWindowActivatable *activatable,
"error", G_CALLBACK (on_error_cb), plugin);
g_signal_connect (priv->tree_widget,
- "notify::filter-pattern",
- G_CALLBACK (on_filter_pattern_changed_cb),
- plugin);
-
- g_signal_connect (priv->tree_widget,
"confirm-delete",
G_CALLBACK (on_confirm_delete_cb),
plugin);
@@ -647,6 +624,12 @@ gedit_file_browser_plugin_activate (GeditWindowActivatable *activatable,
G_CALLBACK (on_selection_changed_cb),
plugin);
+ g_settings_bind (priv->settings,
+ "filter-pattern",
+ priv->tree_widget,
+ "filter-pattern",
+ G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+
panel = gedit_window_get_side_panel (window);
pixbuf = gedit_file_browser_utils_pixbuf_from_theme ("system-file-manager",
GTK_ICON_SIZE_MENU);
@@ -671,10 +654,6 @@ gedit_file_browser_plugin_activate (GeditWindowActivatable *activatable,
add_popup_ui (window, plugin);
- /* Restore filter options */
- /* TODO: bind with gsettings? */
- restore_filter (plugin);
-
/* Install nautilus preferences */
install_nautilus_prefs (plugin);
@@ -686,7 +665,7 @@ gedit_file_browser_plugin_activate (GeditWindowActivatable *activatable,
store = gedit_file_browser_widget_get_browser_store (priv->tree_widget);
- g_settings_bind (plugin->priv->settings,
+ g_settings_bind (priv->settings,
"filter-mode",
store,
"filter-mode",
@@ -919,32 +898,6 @@ on_rename_cb (GeditFileBrowserStore *store,
}
static void
-on_filter_pattern_changed_cb (GeditFileBrowserWidget *widget,
- GParamSpec *param,
- GeditFileBrowserPlugin *plugin)
-{
- GeditFileBrowserPluginPrivate *priv = plugin->priv;
- gchar *pattern;
-
- g_object_get (G_OBJECT (widget), "filter-pattern", &pattern, NULL);
-
- if (pattern == NULL)
- {
- g_settings_set_string (priv->settings,
- FILEBROWSER_FILTER_PATTERN,
- "");
- }
- else
- {
- g_settings_set_string (priv->settings,
- FILEBROWSER_FILTER_PATTERN,
- pattern);
- }
-
- g_free (pattern);
-}
-
-static void
on_virtual_root_changed_cb (GeditFileBrowserStore *store,
GParamSpec *param,
GeditFileBrowserPlugin *plugin)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]