[gnac/devel] Created gnac-settings.[ch]
- From: BenoÃt Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Created gnac-settings.[ch]
- Date: Mon, 12 Dec 2011 17:31:14 +0000 (UTC)
commit aec8b0430a9ad7595a7e68edd7b3377b749cab88
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date: Mon Dec 12 17:30:52 2011 +0000
Created gnac-settings.[ch]
src/Makefile.am | 2 +
src/gnac-main.c | 62 ++-------------
src/gnac-main.h | 30 -------
src/gnac-options.c | 1 +
src/gnac-prefs.c | 32 ++++----
src/gnac-settings.c | 140 ++++++++++++++++++++++++++++++++++
src/gnac-settings.h | 92 ++++++++++++++++++++++
src/gnac-ui.c | 22 ++----
src/gnac-ui.h | 4 -
src/profiles/gnac-profiles-manager.c | 3 +-
src/profiles/gnac-profiles.c | 3 +-
11 files changed, 268 insertions(+), 123 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 2db3761..3cc5f02 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,6 +17,8 @@ gnac_SOURCES = \
gnac-prefs.c \
gnac-properties.h \
gnac-properties.c \
+ gnac-settings.h \
+ gnac-settings.c \
gnac-stock-items.h \
gnac-stock-items.c \
gnac-ui.h \
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 76ca904..4573f7f 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -39,6 +39,7 @@
#include "gnac-playlist.h"
#include "gnac-prefs.h"
#include "gnac-properties.h"
+#include "gnac-settings.h"
#include "gnac-ui.h"
#include "gnac-utils.h"
@@ -64,8 +65,6 @@ guint nb_files_total;
GnacState state = GNAC_AUDIO_EMPTY_STATE;
GnacState prev_state = GNAC_AUDIO_EMPTY_STATE;
-GSettings *settings;
-
LibgnacConverter *converter;
LibgnacMetadata *metadata;
@@ -297,50 +296,6 @@ gnac_add_file(GFile *file)
}
-gboolean
-gnac_settings_set_boolean(const gchar *key,
- gboolean value)
-{
- return gnac_settings_set(key, g_variant_new_boolean(value));
-}
-
-
-gboolean
-gnac_settings_set_int(const gchar *key,
- gint value)
-{
- return gnac_settings_set(key, g_variant_new_int32(value));
-}
-
-
-gboolean
-gnac_settings_set_string(const gchar *key,
- const gchar *value)
-{
- if (!value) return FALSE;
- return gnac_settings_set(key, g_variant_new_string(value));
-}
-
-
-gboolean
-gnac_settings_set(const gchar *key,
- GVariant *value)
-{
- gchar *val_str = g_variant_print(value, FALSE);
- gboolean ret = g_settings_set_value(settings, key, value);
-
- if (!ret) {
- libgnac_debug("Failed to set key \"%s\" to \"%s\"", key, val_str);
- } else {
- libgnac_debug("Key \"%s\" set to \"%s\"", key, val_str);
- }
-
- g_free(val_str);
-
- return ret;
-}
-
-
G_GNUC_NORETURN void
gnac_exit(gint status)
{
@@ -513,7 +468,7 @@ gnac_on_converter_file_completed_cb(LibgnacConverter *converter,
const gchar *uri)
{
/* if delete source is selected, there is nothing else to do */
- if (!g_settings_get_boolean(settings, GNAC_KEY_CLEAR_SOURCE)) return;
+ if (!gnac_settings_get_boolean(GNAC_KEY_CLEAR_SOURCE)) return;
GError *error = NULL;
GFile *file = g_file_new_for_uri(uri);
@@ -667,21 +622,20 @@ gnac_on_ui_convert_cb(GtkWidget *widget,
break;
case GNAC_AUDIO_READY_STATE: {
- gchar *folder_hierarchy = g_settings_get_string(settings,
+ gchar *folder_hierarchy = gnac_settings_get_string(
GNAC_KEY_FOLDER_HIERARCHY_PATTERN);
- gchar *folder_path = g_settings_get_string(settings,
+ gchar *folder_path = gnac_settings_get_string(
GNAC_KEY_DESTINATION_DIRECTORY);
- gchar *rename_pattern = g_settings_get_string(settings,
+ gchar *rename_pattern = gnac_settings_get_string(
GNAC_KEY_RENAME_PATTERN_PATTERN);
g_object_set(G_OBJECT(converter),
"extension", gnac_profiles_get_extension(),
"folder-hierarchy", folder_hierarchy,
"folder-path", folder_path,
- "folder-type", g_settings_get_int(settings, GNAC_KEY_FOLDER_TYPE),
+ "folder-type", gnac_settings_get_int(GNAC_KEY_FOLDER_TYPE),
"audio-description", gnac_profiles_get_pipeline(),
"rename-pattern", rename_pattern,
- "strip-special", g_settings_get_boolean(settings,
- GNAC_KEY_STRIP_SPECIAL),
+ "strip-special", gnac_settings_get_boolean(GNAC_KEY_STRIP_SPECIAL),
NULL);
libgnac_converter_start(converter, &error);
@@ -759,7 +713,7 @@ main(gint argc,
g_set_application_name(PACKAGE_NAME);
- settings = g_settings_new(GNAC_SCHEMA);
+ gnac_settings_init();
/* Parse command line arguments */
gnac_options_init(argc, argv);
diff --git a/src/gnac-main.h b/src/gnac-main.h
index 9063652..9ffcb96 100644
--- a/src/gnac-main.h
+++ b/src/gnac-main.h
@@ -31,17 +31,6 @@
#include "libgnac-converter.h"
-#define GNAC_SCHEMA "org.gnome.Gnac.conversion"
-#define GNAC_KEY_CLEAR_SOURCE "clear-sources"
-#define GNAC_KEY_DESTINATION_DIRECTORY "destination-directory"
-#define GNAC_KEY_FOLDER_HIERARCHY "folder-hierarchy"
-#define GNAC_KEY_FOLDER_HIERARCHY_PATTERN "folder-hierarchy-pattern"
-#define GNAC_KEY_FOLDER_TYPE "folder-type"
-#define GNAC_KEY_LAST_USED_PROFILE "last-used-profile"
-#define GNAC_KEY_RENAME_PATTERN "rename-pattern"
-#define GNAC_KEY_RENAME_PATTERN_PATTERN "rename-pattern-pattern"
-#define GNAC_KEY_STRIP_SPECIAL "strip-special"
-
G_BEGIN_DECLS
typedef enum {
@@ -55,7 +44,6 @@ typedef enum {
} GnacState;
extern GnacState state;
-extern GSettings *settings;
extern guint nb_files_added;
extern guint nb_files_total;
extern LibgnacConverter *converter;
@@ -67,8 +55,6 @@ gnac_add_file(GFile *file);
void
gnac_add_files(GSList *files);
-/* UI Callbacks */
-
void
gnac_on_ui_convert_cb(GtkWidget *widget,
gpointer data);
@@ -77,22 +63,6 @@ void
gnac_on_ui_pause_cb(GtkWidget *widget,
gpointer data);
-gboolean
-gnac_settings_set_boolean(const gchar *key,
- gboolean value);
-
-gboolean
-gnac_settings_set_int(const gchar *key,
- gint value);
-
-gboolean
-gnac_settings_set_string(const gchar *key,
- const gchar *value);
-
-gboolean
-gnac_settings_set(const gchar *key,
- GVariant *value);
-
G_GNUC_NORETURN void
gnac_exit(gint status);
diff --git a/src/gnac-options.c b/src/gnac-options.c
index 8d261bb..3419c2a 100644
--- a/src/gnac-options.c
+++ b/src/gnac-options.c
@@ -32,6 +32,7 @@
#include "gnac-main.h"
#include "gnac-options.h"
+#include "gnac-settings.h"
#include "libgnac-debug.h"
#include "profiles/gnac-profiles-manager.h"
diff --git a/src/gnac-prefs.c b/src/gnac-prefs.c
index c000f66..aca829d 100644
--- a/src/gnac-prefs.c
+++ b/src/gnac-prefs.c
@@ -33,6 +33,7 @@
#include "gnac-main.h"
#include "gnac-prefs.h"
#include "gnac-properties.h"
+#include "gnac-settings.h"
#include "gnac-ui.h"
#include "gnac-ui-utils.h"
#include "gnac-utils.h"
@@ -217,23 +218,23 @@ gnac_prefs_retrieve_settings(void)
gchar *str;
gnac_prefs_set_combo_box_active("output_filename_combo",
- g_settings_get_int(settings, GNAC_KEY_RENAME_PATTERN));
+ gnac_settings_get_int(GNAC_KEY_RENAME_PATTERN));
str = gnac_prefs_get_rename_pattern_as_str();
gnac_prefs_entry_set_text("output_filename_entry", str);
g_free(str);
gnac_prefs_set_combo_box_active("folder_hierarchy_combo",
- g_settings_get_int(settings, GNAC_KEY_FOLDER_HIERARCHY));
+ gnac_settings_get_int(GNAC_KEY_FOLDER_HIERARCHY));
str = gnac_prefs_get_folder_hierarchy_as_str();
gnac_prefs_entry_set_text("folder_hierarchy_entry", str);
g_free(str);
- switch (g_settings_get_int(settings, GNAC_KEY_FOLDER_TYPE))
+ switch (gnac_settings_get_int(GNAC_KEY_FOLDER_TYPE))
{
case FOLDER_SUBDIRECTORY:
- str = g_settings_get_string(settings, GNAC_KEY_DESTINATION_DIRECTORY);
+ str = gnac_settings_get_string(GNAC_KEY_DESTINATION_DIRECTORY);
gnac_prefs_entry_set_text("subfolder_entry", str);
g_free(str);
gnac_prefs_set_toggle_button_active("subfolder_radiobutton", TRUE);
@@ -241,7 +242,7 @@ gnac_prefs_retrieve_settings(void)
break;
case FOLDER_SELECTED:
- str = g_settings_get_string(settings, GNAC_KEY_DESTINATION_DIRECTORY);
+ str = gnac_settings_get_string(GNAC_KEY_DESTINATION_DIRECTORY);
gtk_file_chooser_select_uri(
GTK_FILE_CHOOSER(gnac_prefs_get_widget("filechooserbutton")), str);
g_free(str);
@@ -271,17 +272,14 @@ gnac_prefs_set_parent(void)
static void
gnac_prefs_init_gsettings_bindings(void)
{
- g_settings_bind(settings_ui, GNAC_KEY_TRAY_ICON,
- gnac_prefs_get_widget("check_notification_icon"),
- "active", G_SETTINGS_BIND_DEFAULT);
+ gnac_settings_ui_bind(GNAC_KEY_TRAY_ICON,
+ gnac_prefs_get_widget("check_notification_icon"));
- g_settings_bind(settings, GNAC_KEY_CLEAR_SOURCE,
- gnac_prefs_get_widget("erase_originals_checkbutton"),
- "active", G_SETTINGS_BIND_DEFAULT);
+ gnac_settings_bind(GNAC_KEY_CLEAR_SOURCE,
+ gnac_prefs_get_widget("erase_originals_checkbutton"));
- g_settings_bind(settings, GNAC_KEY_STRIP_SPECIAL,
- gnac_prefs_get_widget("strip_special_checkbutton"),
- "active", G_SETTINGS_BIND_DEFAULT);
+ gnac_settings_bind(GNAC_KEY_STRIP_SPECIAL,
+ gnac_prefs_get_widget("strip_special_checkbutton"));
}
@@ -329,7 +327,7 @@ gnac_prefs_get_rename_pattern_as_str(void)
g_assert(index >= 0 && index <= size);
if (index == size) {
- return g_settings_get_string(settings, GNAC_KEY_RENAME_PATTERN_PATTERN);
+ return gnac_settings_get_string(GNAC_KEY_RENAME_PATTERN_PATTERN);
}
return g_strdup(rename_pattern_default[index]);
@@ -345,7 +343,7 @@ gnac_prefs_get_folder_hierarchy_as_str(void)
g_assert(index >= 0 && index <= size);
if (index == size) {
- return g_settings_get_string(settings, GNAC_KEY_FOLDER_HIERARCHY_PATTERN);
+ return gnac_settings_get_string(GNAC_KEY_FOLDER_HIERARCHY_PATTERN);
}
return g_strdup(folder_hierarchy_default[index]);
@@ -443,7 +441,7 @@ gnac_prefs_update_example_label(GtkWidget *widget,
}
gchar *preview = libgnac_output_get_preview_from_pattern(pattern,
- g_settings_get_boolean(settings, GNAC_KEY_STRIP_SPECIAL));
+ gnac_settings_get_boolean(GNAC_KEY_STRIP_SPECIAL));
g_free(pattern);
gchar *clean_label = g_markup_printf_escaped("%s.%s",
preview, gnac_profiles_get_extension());
diff --git a/src/gnac-settings.c b/src/gnac-settings.c
new file mode 100644
index 0000000..0654886
--- /dev/null
+++ b/src/gnac-settings.c
@@ -0,0 +1,140 @@
+/*
+ * This file is part of GNAC - Gnome Audio Converter
+ *
+ * Copyright (C) 2007 - 2011 Gnac
+ *
+ * - DUPASQUIER Benoit <bdupasqu src gnome org>
+ * - JOAQUIM David <djoaquim src gnome org>
+ * - ROUX Alexandre <alexroux src gnome org>
+ *
+ * GNAC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNAC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNAC; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#include "gnac-settings.h"
+#include "libgnac-debug.h"
+
+
+GSettings *settings;
+GSettings *settings_ui;
+
+
+static gboolean gnac_settings_set(GSettings *settings,
+ const gchar *key,
+ GVariant *value);
+
+void
+gnac_settings_init(void)
+{
+ settings = g_settings_new(GNAC_SCHEMA);
+ settings_ui = g_settings_new(GNAC_SCHEMA_UI);
+}
+
+
+void
+gnac_settings_bind(const gchar *key,
+ gpointer object)
+{
+ g_settings_bind(settings, key, object, "active", G_SETTINGS_BIND_DEFAULT);
+}
+
+
+void
+gnac_settings_ui_bind(const gchar *key,
+ gpointer object)
+{
+ g_settings_bind(settings_ui, key, object, "active", G_SETTINGS_BIND_DEFAULT);
+}
+
+
+gboolean
+gnac_settings_get_boolean(const gchar *key)
+{
+ return g_settings_get_boolean(settings, key);
+}
+
+
+gboolean
+gnac_settings_ui_get_boolean(const gchar *key)
+{
+ return g_settings_get_boolean(settings_ui, key);
+}
+
+
+gboolean
+gnac_settings_set_boolean(const gchar *key,
+ gboolean value)
+{
+ return gnac_settings_set(settings, key, g_variant_new_boolean(value));
+}
+
+
+gboolean
+gnac_settings_ui_set_boolean(const gchar *key,
+ gboolean value)
+{
+ return gnac_settings_set(settings_ui, key, g_variant_new_boolean(value));
+}
+
+
+gint
+gnac_settings_get_int(const gchar *key)
+{
+ return g_settings_get_int(settings, key);
+}
+
+
+gboolean
+gnac_settings_set_int(const gchar *key,
+ gint value)
+{
+ return gnac_settings_set(settings, key, g_variant_new_int32(value));
+}
+
+
+gchar *
+gnac_settings_get_string(const gchar *key)
+{
+ return g_settings_get_string(settings, key);
+}
+
+
+gboolean
+gnac_settings_set_string(const gchar *key,
+ const gchar *value)
+{
+ if (!value) return FALSE;
+ return gnac_settings_set(settings, key, g_variant_new_string(value));
+}
+
+
+static gboolean
+gnac_settings_set(GSettings *settings,
+ const gchar *key,
+ GVariant *value)
+{
+ gchar *val_str = g_variant_print(value, FALSE);
+ gboolean ret = g_settings_set_value(settings, key, value);
+
+ if (!ret) {
+ libgnac_debug("Failed to set key \"%s\" to \"%s\"", key, val_str);
+ } else {
+ libgnac_debug("Key \"%s\" set to \"%s\"", key, val_str);
+ }
+
+ g_free(val_str);
+
+ return ret;
+}
diff --git a/src/gnac-settings.h b/src/gnac-settings.h
new file mode 100644
index 0000000..098b4ac
--- /dev/null
+++ b/src/gnac-settings.h
@@ -0,0 +1,92 @@
+/*
+ * This file is part of GNAC - Gnome Audio Converter
+ *
+ * Copyright (C) 2007 - 2011 Gnac
+ *
+ * - DUPASQUIER Benoit <bdupasqu src gnome org>
+ * - JOAQUIM David <djoaquim src gnome org>
+ * - ROUX Alexandre <alexroux src gnome org>
+ *
+ * GNAC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNAC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNAC; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA
+ */
+
+#ifndef GNAC_SETTINGS_H
+#define GNAC_SETTINGS_H
+
+#include <gio/gio.h>
+#include <glib.h>
+
+#define GNAC_SCHEMA "org.gnome.Gnac.conversion"
+#define GNAC_KEY_CLEAR_SOURCE "clear-sources"
+#define GNAC_KEY_DESTINATION_DIRECTORY "destination-directory"
+#define GNAC_KEY_FOLDER_HIERARCHY "folder-hierarchy"
+#define GNAC_KEY_FOLDER_HIERARCHY_PATTERN "folder-hierarchy-pattern"
+#define GNAC_KEY_FOLDER_TYPE "folder-type"
+#define GNAC_KEY_LAST_USED_PROFILE "last-used-profile"
+#define GNAC_KEY_RENAME_PATTERN "rename-pattern"
+#define GNAC_KEY_RENAME_PATTERN_PATTERN "rename-pattern-pattern"
+#define GNAC_KEY_STRIP_SPECIAL "strip-special"
+
+#define GNAC_SCHEMA_UI "org.gnome.Gnac.ui"
+#define GNAC_KEY_TRAY_ICON "tray-icon"
+#define GNAC_KEY_TOOLBAR_VISIBLE "toolbar-visible"
+
+G_BEGIN_DECLS
+
+extern GSettings *settings;
+
+void
+gnac_settings_init(void);
+
+void
+gnac_settings_bind(const gchar *key,
+ gpointer object);
+
+void
+gnac_settings_ui_bind(const gchar *key,
+ gpointer object);
+
+gboolean
+gnac_settings_get_boolean(const gchar *key);
+
+gboolean
+gnac_settings_ui_get_boolean(const gchar *key);
+
+gboolean
+gnac_settings_set_boolean(const gchar *key,
+ gboolean value);
+
+gboolean
+gnac_settings_ui_set_boolean(const gchar *key,
+ gboolean value);
+
+gint
+gnac_settings_get_int(const gchar *key);
+
+gboolean
+gnac_settings_set_int(const gchar *key,
+ gint value);
+
+gchar *
+gnac_settings_get_string(const gchar *key);
+
+gboolean
+gnac_settings_set_string(const gchar *key,
+ const gchar *value);
+
+G_END_DECLS
+
+#endif /* GNAC_SETTINGS_H */
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 9047851..567bbbd 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -45,6 +45,7 @@
#include "gnac-options.h"
#include "gnac-prefs.h"
#include "gnac-properties.h"
+#include "gnac-settings.h"
#include "gnac-stock-items.h"
#include "gnac-ui.h"
#include "gnac-ui-utils.h"
@@ -53,7 +54,6 @@
#include "profiles/gnac-profiles.h"
#include "profiles/gnac-profiles-manager.h"
-GSettings *settings_ui;
static GSList *filters;
static GtkBuilder *gnac_main_builder = NULL;
@@ -399,8 +399,7 @@ gnac_ui_show_toolbar(void)
{
GtkToggleAction *view_toolbar = GTK_TOGGLE_ACTION(
gnac_ui_get_action("view_toolbar_item"));
- gboolean visible = g_settings_get_boolean(settings_ui,
- GNAC_KEY_TOOLBAR_VISIBLE);
+ gboolean visible = gnac_settings_ui_get_boolean(GNAC_KEY_TOOLBAR_VISIBLE);
gtk_toggle_action_set_active(view_toolbar, visible);
gnac_ui_set_widget_visible("main_toolbar", visible);
}
@@ -852,7 +851,7 @@ gnac_ui_on_view_toolbar_cb(GtkAction *action,
GtkWidget *toolbar = gnac_ui_get_widget("main_toolbar");
gboolean visible = !gtk_widget_get_visible(toolbar);
gtk_widget_set_visible(toolbar, visible);
- g_settings_set_boolean(settings_ui, GNAC_KEY_TOOLBAR_VISIBLE, visible);
+ gnac_settings_ui_set_boolean(GNAC_KEY_TOOLBAR_VISIBLE, visible);
}
@@ -1058,7 +1057,6 @@ gnac_ui_init_unique(void)
void
gnac_ui_init(void)
{
- settings_ui = g_settings_new(GNAC_SCHEMA_UI);
gnac_ui_init_notify();
gnac_ui_init_unique();
}
@@ -1207,7 +1205,7 @@ gnac_ui_query_tooltip_cb(GtkStatusIcon *status_icon,
void
gnac_ui_show_trayicon(void)
{
- if (!g_settings_get_boolean(settings_ui, GNAC_KEY_TRAY_ICON)) return;
+ if (!gnac_settings_ui_get_boolean(GNAC_KEY_TRAY_ICON)) return;
GtkWidget *main_window = gnac_ui_get_widget("main_window");
@@ -1241,11 +1239,7 @@ gnac_ui_main_window_is_visible(void)
void
gnac_ui_hide_trayicon(void)
{
- if (!g_settings_get_boolean(settings_ui, GNAC_KEY_TRAY_ICON) ||
- !trayicon)
- {
- return;
- }
+ if (!gnac_settings_ui_get_boolean(GNAC_KEY_TRAY_ICON) || !trayicon) return;
GtkWidget *main_window = gnac_ui_get_widget("main_window");
@@ -1302,11 +1296,7 @@ gnac_ui_on_trayicon_popup(GtkStatusIcon *trayicon,
void
gnac_ui_trayicon_tooltip_update(const gchar *tooltip)
{
- if (!g_settings_get_boolean(settings_ui, GNAC_KEY_TRAY_ICON) ||
- !trayicon)
- {
- return;
- }
+ if (!gnac_settings_get_boolean(GNAC_KEY_TRAY_ICON) || !trayicon) return;
g_free(tooltip_path);
tooltip_path = g_strdup(tooltip);
diff --git a/src/gnac-ui.h b/src/gnac-ui.h
index c4027ef..09c6d8f 100644
--- a/src/gnac-ui.h
+++ b/src/gnac-ui.h
@@ -31,10 +31,6 @@
#include "gnac-options.h"
-#define GNAC_SCHEMA_UI "org.gnome.Gnac.ui"
-#define GNAC_KEY_TRAY_ICON "tray-icon"
-#define GNAC_KEY_TOOLBAR_VISIBLE "toolbar-visible"
-
G_BEGIN_DECLS
enum {
diff --git a/src/profiles/gnac-profiles-manager.c b/src/profiles/gnac-profiles-manager.c
index 68f2320..690df08 100644
--- a/src/profiles/gnac-profiles-manager.c
+++ b/src/profiles/gnac-profiles-manager.c
@@ -34,6 +34,7 @@
#include "gnac-profiles.h"
#include "gnac-profiles-default.h"
#include "gnac-profiles-manager.h"
+#include "gnac-settings.h"
#include "gnac-ui.h"
#include "gnac-ui-utils.h"
#include "gnac-utils.h"
@@ -283,7 +284,7 @@ gnac_profiles_mgr_list_profiles(void)
g_print(_("Available audio profiles:"));
g_print("\n\n");
- gchar *last_used_profile = g_settings_get_string(settings,
+ gchar *last_used_profile = gnac_settings_get_string(
GNAC_KEY_LAST_USED_PROFILE);
GFileInfo *file_info;
diff --git a/src/profiles/gnac-profiles.c b/src/profiles/gnac-profiles.c
index 392f943..a24a39f 100755
--- a/src/profiles/gnac-profiles.c
+++ b/src/profiles/gnac-profiles.c
@@ -32,6 +32,7 @@
#include "gnac-main.h"
#include "gnac-profiles.h"
#include "gnac-profiles-manager.h"
+#include "gnac-settings.h"
#include "gnac-ui.h"
#include "gnac-utils.h"
@@ -107,7 +108,7 @@ gnac_profiles_select_last_used_profile(void)
gboolean has_next = gtk_tree_model_get_iter_first(model, &iter);
gboolean found = FALSE;
- gchar *last_used_profile = g_settings_get_string(settings,
+ gchar *last_used_profile = gnac_settings_get_string(
GNAC_KEY_LAST_USED_PROFILE);
while (has_next && !found) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]