[file-roller] removed some deprecated functions
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] removed some deprecated functions
- Date: Tue, 29 Apr 2014 07:29:14 +0000 (UTC)
commit c1f713eac6ae0b9b52b865b3ebf1b5e6751509fc
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Apr 27 15:39:01 2014 +0200
removed some deprecated functions
src/fr-window.c | 15 ++-------------
src/glib-utils.c | 20 ++++++++++++++++++++
src/glib-utils.h | 5 +++++
3 files changed, 27 insertions(+), 13 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index a71d3c7..d64dbee 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5299,7 +5299,6 @@ fr_window_construct (FrWindow *window)
GtkTreeSelection *selection;
GtkSizeGroup *toolbar_size_group;
GtkSizeGroup *header_bar_size_group;
- const char * const *schemas;
/* Create the settings objects */
@@ -5307,17 +5306,7 @@ fr_window_construct (FrWindow *window)
window->priv->settings_ui = g_settings_new (FILE_ROLLER_SCHEMA_UI);
window->priv->settings_general = g_settings_new (FILE_ROLLER_SCHEMA_GENERAL);
window->priv->settings_dialogs = g_settings_new (FILE_ROLLER_SCHEMA_DIALOGS);
-
- /* Only use the nautilus schema if it's installed */
- for (schemas = g_settings_list_schemas ();
- *schemas != NULL;
- schemas++)
- {
- if (g_strcmp0 (*schemas, NAUTILUS_SCHEMA) == 0) {
- window->priv->settings_nautilus = g_settings_new (NAUTILUS_SCHEMA);
- break;
- }
- }
+ window->priv->settings_nautilus = _g_settings_new_if_schema_installed (NAUTILUS_SCHEMA);
/* Create the application. */
@@ -5669,7 +5658,7 @@ fr_window_construct (FrWindow *window)
FALSE,
0);
gtk_widget_show_all (navigation_commands);
- gtk_widget_set_margin_right (navigation_commands, 12);
+ gtk_widget_set_margin_end (navigation_commands, 12);
gtk_box_pack_start (GTK_BOX (location_bar_content), navigation_commands, FALSE, FALSE, 5);
/* current location */
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 372da12..5788d65 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -1422,6 +1422,26 @@ _g_key_file_get_string_list (GKeyFile *key_file,
}
+/* GSettings utils */
+
+
+GSettings *
+_g_settings_new_if_schema_installed (const char *schema_id)
+{
+ GSettingsSchema *schema;
+
+ schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
+ schema_id,
+ TRUE);
+ if (schema == NULL)
+ return NULL;
+
+ g_settings_schema_unref (schema);
+
+ return g_settings_new (schema_id);
+}
+
+
/* line parser */
diff --git a/src/glib-utils.h b/src/glib-utils.h
index 488c225..7db48ba 100644
--- a/src/glib-utils.h
+++ b/src/glib-utils.h
@@ -183,6 +183,11 @@ GList * _g_key_file_get_string_list (GKeyFile *key_fil
const char *key,
GError **error);
+/* GSettings utils */
+
+GSettings * _g_settings_new_if_schema_installed
+ (const char *schema_id);
+
/* functions used to parse a command output lines. */
gboolean _g_line_matches_pattern (const char *line,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]