[gnome-utils/gsettings-tutorial: 17/22] [gsettings-tutorial] Remove remaining gconf code from baobab-utils.c
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils/gsettings-tutorial: 17/22] [gsettings-tutorial] Remove remaining gconf code from baobab-utils.c
- Date: Sat, 17 Apr 2010 00:08:18 +0000 (UTC)
commit 74a97223193b9d1910bfd649a9a5f534589e45f2
Author: Vincent Untz <vuntz gnome org>
Date: Fri Apr 16 18:49:11 2010 -0400
[gsettings-tutorial] Remove remaining gconf code from baobab-utils.c
baobab_gconf_get_string_with_default() is simple and needed only once,
so we can just remove it by including the code from where it was called.
baobab/src/baobab-utils.c | 11 -----------
baobab/src/baobab-utils.h | 1 -
baobab/src/baobab.c | 8 +++++---
3 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/baobab/src/baobab-utils.c b/baobab/src/baobab-utils.c
index 7624f8f..d48122e 100644
--- a/baobab/src/baobab-utils.c
+++ b/baobab/src/baobab-utils.c
@@ -538,17 +538,6 @@ trash_file (GFile *file)
return TRUE;
}
-gchar *
-baobab_gconf_get_string_with_default (GConfClient *client,
- const gchar *key,
- const gchar *def)
-{
- gchar *val;
-
- val = gconf_client_get_string (client, key, NULL);
- return val ? val : g_strdup (def);
-}
-
gboolean
baobab_help_display (GtkWindow *parent,
const gchar *file_name,
diff --git a/baobab/src/baobab-utils.h b/baobab/src/baobab-utils.h
index c5af605..b1bf8cd 100644
--- a/baobab/src/baobab-utils.h
+++ b/baobab/src/baobab-utils.h
@@ -44,7 +44,6 @@ gboolean can_trash_file (GFile *file);
gboolean trash_file (GFile *file);
void set_ui_action_sens (const gchar *name, gboolean sens);
void set_ui_widget_sens (const gchar *name, gboolean sens);
-gchar *baobab_gconf_get_string_with_default (GConfClient *client, const gchar *key, const gchar *def);
gboolean baobab_help_display (GtkWindow *parent, const gchar *file_name, const gchar *link_id);
gboolean is_virtual_filesystem (GFile *file);
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index e948f5b..78fda1b 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -555,9 +555,11 @@ baobab_toolbar_style (GConfClient *client,
{
gchar *toolbar_setting;
- toolbar_setting = baobab_gconf_get_string_with_default (baobab.gconf_client,
- SYSTEM_TOOLBAR_STYLE,
- "both");
+ toolbar_setting = gconf_client_get_string (baobab.gconf_client,
+ SYSTEM_TOOLBAR_STYLE,
+ NULL);
+ if (!toolbar_setting)
+ toolbar_setting = g_strdup ("both");
if (!strcmp(toolbar_setting, "icons")) {
gtk_toolbar_set_style (GTK_TOOLBAR(baobab.toolbar),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]