diff options
author | Vincent Sanders <vince@kyllikki.org> | 2016-10-19 11:12:19 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2016-10-19 11:12:19 +0100 |
commit | 601d9da66d173152fcc095d271b08b43a02ca905 (patch) | |
tree | f705edb13239f3664a1197b9ac20f33380d97f74 /frontends/windows/prefs.c | |
parent | 7d808e95496b8f2175537f03dd2edd6bb58156c9 (diff) | |
download | netsurf-601d9da66d173152fcc095d271b08b43a02ca905.tar.gz netsurf-601d9da66d173152fcc095d271b08b43a02ca905.tar.bz2 |
fix windows user preferences location storage
Diffstat (limited to 'frontends/windows/prefs.c')
-rw-r--r-- | frontends/windows/prefs.c | 21 |
1 files changed, 19 insertions, 2 deletions
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(); } } |