summaryrefslogtreecommitdiff
path: root/src/dlg-add-files.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-11-05 14:08:40 -0800
committerStefano Karapetsas <[email protected]>2012-11-05 14:08:40 -0800
commit0d97b91e417fda108955b155cc287db086850c81 (patch)
tree5fd33bf86621b0de3aa2cb30b7b940f74c979749 /src/dlg-add-files.c
parent8f8784ba4ebcd8eb099c4e119a9a8d5a349efd61 (diff)
parent61fe44bd16be34d89b127f403b3e07d63aa67e89 (diff)
downloadengrampa-0d97b91e417fda108955b155cc287db086850c81.tar.bz2
engrampa-0d97b91e417fda108955b155cc287db086850c81.tar.xz
Merge pull request #7 from NiceandGently/master
port to gsettings
Diffstat (limited to 'src/dlg-add-files.c')
-rw-r--r--src/dlg-add-files.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dlg-add-files.c b/src/dlg-add-files.c
index ce53043..6de4e57 100644
--- a/src/dlg-add-files.c
+++ b/src/dlg-add-files.c
@@ -28,13 +28,13 @@
#include "file-utils.h"
#include "fr-stock.h"
#include "fr-window.h"
-#include "mateconf-utils.h"
#include "gtk-utils.h"
#include "preferences.h"
typedef struct {
FrWindow *window;
+ GSettings *settings;
GtkWidget *dialog;
GtkWidget *add_if_newer_checkbutton;
} DialogData;
@@ -44,6 +44,7 @@ static void
open_file_destroy_cb (GtkWidget *file_sel,
DialogData *data)
{
+ g_object_unref (data->settings);
g_free (data);
}
@@ -63,8 +64,8 @@ file_sel_response_cb (GtkWidget *widget,
current_folder = gtk_file_chooser_get_current_folder_uri (file_sel);
uri = gtk_file_chooser_get_uri (file_sel);
- eel_mateconf_set_string (PREF_ADD_CURRENT_FOLDER, current_folder);
- eel_mateconf_set_string (PREF_ADD_FILENAME, uri);
+ g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, current_folder);
+ g_settings_set_string (data->settings, PREF_ADD_FILENAME, uri);
fr_window_set_add_default_dir (window, current_folder);
g_free (uri);
@@ -138,6 +139,7 @@ add_files_cb (GtkWidget *widget,
data = g_new0 (DialogData, 1);
data->window = callback_data;
+ data->settings = g_settings_new (ENGRAMPA_SCHEMA_ADD);
data->dialog = file_sel =
gtk_file_chooser_dialog_new (_("Add Files"),
GTK_WINDOW (data->window),
@@ -168,7 +170,7 @@ add_files_cb (GtkWidget *widget,
/* set data */
- folder = eel_mateconf_get_string (PREF_ADD_CURRENT_FOLDER, "");
+ folder = g_settings_get_string (data->settings, PREF_ADD_CURRENT_FOLDER);
if ((folder == NULL) || (strcmp (folder, "") == 0))
folder = g_strdup (fr_window_get_add_default_dir (data->window));
gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (file_sel), folder);