mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 13:37:02 +03:00
Move current user options path to an abstracted nsoptions_read/write function
This commit is contained in:
parent
df8aeb4a88
commit
6a9a8d6127
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 */
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 *)
|
||||
|
Loading…
Reference in New Issue
Block a user