1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

update_cache_document_options: take @ses and pass it to get_opt calls

change_hook_active_link: pass update_cache_document_options @ses.

Now when changing the global settings, it will not simply copy the new values for the global settings to the document-options cache, but also check session-specific settings.  This doesn't really matter yet, since the options in question can't be set on a per-session basis, but is in preparation for future changes.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-08-30 19:08:24 +00:00 committed by Miciah Dashiel Butler Masters
parent f5e6ed4dd7
commit 5ada24f3ef
3 changed files with 9 additions and 9 deletions

View File

@ -953,7 +953,7 @@ change_hook_insert_mode(struct session *ses, struct option *current, struct opti
static int
change_hook_active_link(struct session *ses, struct option *current, struct option *changed)
{
update_cached_document_options();
update_cached_document_options(ses);
return 0;
}

View File

@ -211,18 +211,18 @@ get_document_css_magic(struct document *document)
#endif
void
update_cached_document_options(void)
update_cached_document_options(struct session *ses)
{
struct document *document;
struct active_link_options active_link;
memset(&active_link, 0, sizeof(active_link)); /* Safer. */
active_link.fg = get_opt_color("document.browse.links.active_link.colors.text", NULL);
active_link.bg = get_opt_color("document.browse.links.active_link.colors.background", NULL);
active_link.color = get_opt_bool("document.browse.links.active_link.enable_color", NULL);
active_link.invert = get_opt_bool("document.browse.links.active_link.invert", NULL);
active_link.underline = get_opt_bool("document.browse.links.active_link.underline", NULL);
active_link.bold = get_opt_bool("document.browse.links.active_link.bold", NULL);
active_link.fg = get_opt_color("document.browse.links.active_link.colors.text", ses);
active_link.bg = get_opt_color("document.browse.links.active_link.colors.background", ses);
active_link.color = get_opt_bool("document.browse.links.active_link.enable_color", ses);
active_link.invert = get_opt_bool("document.browse.links.active_link.invert", ses);
active_link.underline = get_opt_bool("document.browse.links.active_link.underline", ses);
active_link.bold = get_opt_bool("document.browse.links.active_link.bold", ses);
foreach (document, format_cache) {
copy_struct(&document->options.active_link, &active_link);

View File

@ -223,7 +223,7 @@ void done_link_members(struct link *link);
* validity of formatted documents in the cache. */
unsigned long get_document_css_magic(struct document *document);
void update_cached_document_options(void);
void update_cached_document_options(struct session *ses);
struct document *get_cached_document(struct cache_entry *cached, struct document_options *options);