summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2016-07-09 01:07:18 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2016-07-09 01:07:18 +0100
commit6a9a8d6127e3fd677dc8ad28d14b4d84b3dfdc40 (patch)
treec99f9e9e53821975445f0224b2a5f4a66d444873 /frontends
parentdf8aeb4a88210b5ce0738b08d96f619f6ce6bfea (diff)
downloadnetsurf-6a9a8d6127e3fd677dc8ad28d14b4d84b3dfdc40.tar.gz
netsurf-6a9a8d6127e3fd677dc8ad28d14b4d84b3dfdc40.tar.bz2
Move current user options path to an abstracted nsoptions_read/write function
Diffstat (limited to 'frontends')
-rw-r--r--frontends/amiga/Makefile2
-rw-r--r--frontends/amiga/gui.c8
-rwxr-xr-xfrontends/amiga/gui_options.c5
-rwxr-xr-xfrontends/amiga/gui_options.h2
-rw-r--r--frontends/amiga/menu.c3
5 files changed, 9 insertions, 11 deletions
diff --git a/frontends/amiga/Makefile b/frontends/amiga/Makefile
index 22bf85b7a..eb3c70b85 100644
--- a/frontends/amiga/Makefile
+++ b/frontends/amiga/Makefile
@@ -45,7 +45,7 @@ S_FRONTEND := gui.c tree.c history.c hotlist.c schedule.c file.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c os3support.c font_diskfont.c \
- selectmenu.c hash/xxhash.c font_cache.c font_bullet.c
+ selectmenu.c hash/xxhash.c font_cache.c font_bullet.c nsoption.c
# This is the final source build list
# Note this is deliberately *not* expanded here as common and image
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9e57bc780..815ffb7fd 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -776,7 +776,7 @@ static void ami_openscreen(void)
id = screenmodereq->sm_DisplayID;
sprintf(modeid, "0x%lx", id);
nsoption_set_charp(screen_modeid, modeid);
- nsoption_write(current_user_options, NULL, NULL);
+ ami_nsoption_write();
}
FreeAslRequest(screenmodereq);
}
@@ -5643,7 +5643,7 @@ int main(int argc, char** argv)
if((lock = CreateDirTree(current_user_dir)))
UnLock(lock);
- current_user_options = ASPrintf("%s/Choices", current_user_dir);
+ ami_nsoption_set_location(current_user_dir);
current_user_cache = ASPrintf("%s/Cache", current_user_dir);
current_user_faviconcache = ASPrintf("%s/IconCache", current_user_dir);
@@ -5672,7 +5672,7 @@ int main(int argc, char** argv)
ami_libs_close();
return RETURN_FAIL;
}
- nsoption_read(current_user_options, NULL);
+ ami_nsoption_read();
if(args != NULL) {
nsoption_commandline(&nargc, &nargv, NULL);
FreeArgs(args);
@@ -5742,7 +5742,7 @@ int main(int argc, char** argv)
netsurf_exit();
- FreeVec(current_user_options);
+ ami_nsoption_free();
FreeVec(current_user_dir);
FreeVec(current_user_faviconcache);
FreeVec(current_user);
diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c
index 21067fb40..2b1b7c944 100755
--- a/frontends/amiga/gui_options.c
+++ b/frontends/amiga/gui_options.c
@@ -74,6 +74,7 @@
#include "amiga/help.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
+#include "amiga/nsoption.h"
#include "amiga/object.h"
#include "amiga/selectmenu.h"
#include "amiga/theme.h"
@@ -233,8 +234,6 @@ struct ami_gui_opts_window {
#endif
};
-char *current_user_options = NULL;
-
static struct ami_gui_opts_window *gow = NULL;
static CONST_STRPTR tabs[OPTS_MAX_TABS];
@@ -2057,7 +2056,7 @@ static void ami_gui_opts_use(bool save)
}
if(save == true) {
- nsoption_write(current_user_options, NULL, NULL);
+ ami_nsoption_write();
ami_font_savescanner(); /* just in case it has changed and been used only */
}
diff --git a/frontends/amiga/gui_options.h b/frontends/amiga/gui_options.h
index 3d680845b..abb0b111c 100755
--- a/frontends/amiga/gui_options.h
+++ b/frontends/amiga/gui_options.h
@@ -26,7 +26,5 @@ void ami_gui_opts_close(void);
/* Web search list */
struct List *ami_gui_opts_websearch(void);
void ami_gui_opts_websearch_free(struct List *websearchlist);
-
-extern char *current_user_options;
#endif
diff --git a/frontends/amiga/menu.c b/frontends/amiga/menu.c
index 479bf8188..0fd730ed8 100644
--- a/frontends/amiga/menu.c
+++ b/frontends/amiga/menu.c
@@ -69,6 +69,7 @@
#include "amiga/libs.h"
#include "amiga/menu.h"
#include "amiga/misc.h"
+#include "amiga/nsoption.h"
#include "amiga/print.h"
#include "amiga/search.h"
#include "amiga/theme.h"
@@ -484,7 +485,7 @@ HOOKF(void, ami_menu_item_settings_snapshot, APTR, window, struct IntuiMessage *
HOOKF(void, ami_menu_item_settings_save, APTR, window, struct IntuiMessage *)
{
- nsoption_write(current_user_options, NULL, NULL);
+ ami_nsoption_write();
}
HOOKF(void, ami_menu_item_arexx_execute, APTR, window, struct IntuiMessage *)