summaryrefslogtreecommitdiff
path: root/gtk/dialogs/preferences.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-04-28 16:37:00 +0100
committerVincent Sanders <vince@kyllikki.org>2014-04-28 16:37:00 +0100
commit1fd565cba706d6a9e809d14f79ceb92633b62ead (patch)
treee7672a80a2ddcbc35144ea2a2f5b72e8e9cacd71 /gtk/dialogs/preferences.c
parentc0ac05d39c10ff39c8f4874bdbbe192dca07e910 (diff)
downloadnetsurf-1fd565cba706d6a9e809d14f79ceb92633b62ead.tar.gz
netsurf-1fd565cba706d6a9e809d14f79ceb92633b62ead.tar.bz2
make GTK configuration handling conform to XDG specification.
Diffstat (limited to 'gtk/dialogs/preferences.c')
-rw-r--r--gtk/dialogs/preferences.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/gtk/dialogs/preferences.c b/gtk/dialogs/preferences.c
index a8ff67465..fcf30c8fa 100644
--- a/gtk/dialogs/preferences.c
+++ b/gtk/dialogs/preferences.c
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <math.h>
+#include "utils/filepath.h"
#include "utils/log.h"
#include "utils/utils.h"
#include "utils/messages.h"
@@ -1001,8 +1002,14 @@ nsgtk_preferences_fileChooserDownloads_realize(GtkWidget *widget,
G_MODULE_EXPORT void
nsgtk_preferences_dialogPreferences_response(GtkDialog *dlg, gint resid)
{
+ char *choices;
+
if (resid == GTK_RESPONSE_CLOSE) {
- nsoption_write(options_file_location, NULL, NULL);
+ choices = filepath_append(nsgtk_config_home, "Choices");
+ if (choices != NULL) {
+ nsoption_write(choices, NULL, NULL);
+ free(choices);
+ }
gtk_widget_hide(GTK_WIDGET(dlg));
}
}
@@ -1011,18 +1018,32 @@ G_MODULE_EXPORT gboolean
nsgtk_preferences_dialogPreferences_deleteevent(GtkDialog *dlg,
struct ppref *priv)
{
- nsoption_write(options_file_location, NULL, NULL);
+ char *choices;
+
+ choices = filepath_append(nsgtk_config_home, "Choices");
+ if (choices != NULL) {
+ nsoption_write(choices, NULL, NULL);
+ free(choices);
+ }
+
gtk_widget_hide(GTK_WIDGET(dlg));
- /* delt with it by hiding window, no need to destory widget by
- * default */
+ /* Delt with it by hiding window, no need to destory widget by
+ * default.
+ */
return TRUE;
}
G_MODULE_EXPORT void
nsgtk_preferences_dialogPreferences_destroy(GtkDialog *dlg, struct ppref *priv)
{
- nsoption_write(options_file_location, NULL, NULL);
+ char *choices;
+
+ choices = filepath_append(nsgtk_config_home, "Choices");
+ if (choices != NULL) {
+ nsoption_write(choices, NULL, NULL);
+ free(choices);
+ }
}