[gnome-utils] Move gconf notifications functions all in the same place
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils] Move gconf notifications functions all in the same place
- Date: Sat, 24 Jul 2010 12:04:31 +0000 (UTC)
commit e940c8d71f312b7b87c128a47685da45256c22ed
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Jul 24 12:04:43 2010 +0200
Move gconf notifications functions all in the same place
baobab/src/baobab-prefs.c | 24 --------------------
baobab/src/baobab-prefs.h | 5 ----
baobab/src/baobab.c | 53 ++++++++++++++++++++++++++++++++------------
3 files changed, 38 insertions(+), 44 deletions(-)
---
diff --git a/baobab/src/baobab-prefs.c b/baobab/src/baobab-prefs.c
index 23bfd0a..0bfa5ff 100644
--- a/baobab/src/baobab-prefs.c
+++ b/baobab/src/baobab-prefs.c
@@ -56,30 +56,6 @@ static gboolean set_model_checks (GtkTreeModel * model, GtkTreePath * path,
static void enable_home_cb (GtkToggleButton * togglebutton,
gpointer user_data);
-
-void
-props_notify (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- GSList *uris;
-
- uris = gconf_client_get_list (client,
- PROPS_SCAN_KEY,
- GCONF_VALUE_STRING,
- NULL);
- baobab_set_excluded_locations (uris);
- g_slist_foreach (uris, (GFunc) g_free, NULL);
- g_slist_free (uris);
-
- baobab_get_filesystem (&g_fs);
- set_label_scan (&g_fs);
- show_label ();
- gtk_tree_store_clear (baobab.model);
- first_row ();
-}
-
static void
filechooser_response_cb (GtkDialog *dialog,
gint response_id,
diff --git a/baobab/src/baobab-prefs.h b/baobab/src/baobab-prefs.h
index 379cf9d..ee3248d 100644
--- a/baobab/src/baobab-prefs.h
+++ b/baobab/src/baobab-prefs.h
@@ -36,11 +36,6 @@ enum
TOT_COLUMNS
};
-void props_notify (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data);
-
void create_props (void);
#endif /* __BAOBAB_PROPS_H__ */
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 7c799f3..d2722ea 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -485,20 +485,6 @@ pop_iter_from_stack (void)
return iter;
}
-void
-baobab_set_excluded_locations (GSList *excluded_uris)
-{
- GSList *l;
-
- g_slist_foreach (baobab.excluded_locations, (GFunc) g_object_unref, NULL);
- g_slist_free (baobab.excluded_locations);
- baobab.excluded_locations = NULL;
- for (l = excluded_uris; l != NULL; l = l->next) {
- baobab.excluded_locations = g_slist_prepend (baobab.excluded_locations,
- g_file_new_for_uri (l->data));
- }
-}
-
gboolean
baobab_is_excluded_location (GFile *file)
{
@@ -681,6 +667,20 @@ baobab_subfolderstips_toggled (GConfClient *client,
NULL));
}
+void
+baobab_set_excluded_locations (GSList *excluded_uris)
+{
+ GSList *l;
+
+ g_slist_foreach (baobab.excluded_locations, (GFunc) g_object_unref, NULL);
+ g_slist_free (baobab.excluded_locations);
+ baobab.excluded_locations = NULL;
+ for (l = excluded_uris; l != NULL; l = l->next) {
+ baobab.excluded_locations = g_slist_prepend (baobab.excluded_locations,
+ g_file_new_for_uri (l->data));
+ }
+}
+
static void
store_excluded_locations (void)
{
@@ -724,6 +724,29 @@ sanity_check_excluded_locations (void)
}
static void
+excluded_locations_changed (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ GSList *uris;
+
+ uris = gconf_client_get_list (client,
+ PROPS_SCAN_KEY,
+ GCONF_VALUE_STRING,
+ NULL);
+ baobab_set_excluded_locations (uris);
+ g_slist_foreach (uris, (GFunc) g_free, NULL);
+ g_slist_free (uris);
+
+ baobab_get_filesystem (&g_fs);
+ set_label_scan (&g_fs);
+ show_label ();
+ gtk_tree_store_clear (baobab.model);
+ first_row ();
+}
+
+static void
volume_changed (GVolumeMonitor *volume_monitor,
GVolume *volume,
gpointer user_data)
@@ -828,7 +851,7 @@ baobab_init (void)
baobab.gconf_client = gconf_client_get_default ();
gconf_client_add_dir (baobab.gconf_client, BAOBAB_KEY_DIR,
GCONF_CLIENT_PRELOAD_NONE, NULL);
- gconf_client_notify_add (baobab.gconf_client, PROPS_SCAN_KEY, props_notify,
+ gconf_client_notify_add (baobab.gconf_client, PROPS_SCAN_KEY, excluded_locations_changed,
NULL, NULL, NULL);
gconf_client_notify_add (baobab.gconf_client, SYSTEM_TOOLBAR_STYLE, baobab_toolbar_style,
NULL, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]