From 601d9da66d173152fcc095d271b08b43a02ca905 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 19 Oct 2016 11:12:19 +0100 Subject: fix windows user preferences location storage --- frontends/windows/prefs.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'frontends/windows/prefs.c') diff --git a/frontends/windows/prefs.c b/frontends/windows/prefs.c index adc0101a7..286bfb0a1 100644 --- a/frontends/windows/prefs.c +++ b/frontends/windows/prefs.c @@ -25,6 +25,8 @@ #include "utils/log.h" #include "utils/messages.h" #include "utils/utils.h" +#include "utils/file.h" + #include "windows/gui.h" #include "windows/prefs.h" #include "windows/resourceid.h" @@ -628,6 +630,22 @@ static BOOL CALLBACK options_general_dialog_handler(HWND hwnd, return FALSE; } +/* exported interface documented in windows/prefs.h */ +nserror nsws_prefs_save(void) +{ + /* user saved changes */ + char *choices = NULL; + nserror res; + + res = netsurf_mkpath(&choices, NULL, 2, nsw32_config_home, "Choices"); + if (res == NSERROR_OK) { + nsoption_write(choices, NULL, NULL); + free(choices); + } + return res; +} + +/* exported interface documented in windows/prefs.h */ void nsws_prefs_dialog_init(HINSTANCE hinst, HWND parent) { int ret; @@ -674,7 +692,6 @@ void nsws_prefs_dialog_init(HINSTANCE hinst, HWND parent) if (ret == -1) { win_perror("PropertySheet"); } else if (ret > 0) { - /* user saved changes */ - nsoption_write(options_file_location, NULL, NULL); + nsws_prefs_save(); } } -- cgit v1.2.3