mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
option_changed: Merge the 2nd and 3rd parameter.
All callers were passing the same value for both.
This commit is contained in:
parent
7bfd9703d9
commit
2e5488ba3d
@ -275,9 +275,7 @@ check_valid_option(struct dialog_data *dlg_data, struct widget_data *widget_data
|
|||||||
if (chinon) {
|
if (chinon) {
|
||||||
if (option_types[option->type].set &&
|
if (option_types[option->type].set &&
|
||||||
option_types[option->type].set(option, chinon)) {
|
option_types[option->type].set(option, chinon)) {
|
||||||
struct option *current = option;
|
option_changed(ses, option);
|
||||||
|
|
||||||
option_changed(ses, current, option);
|
|
||||||
|
|
||||||
commandline = 0;
|
commandline = 0;
|
||||||
mem_free(chinon);
|
mem_free(chinon);
|
||||||
|
@ -956,7 +956,7 @@ toggle_option(struct session *ses, struct option *option)
|
|||||||
assert(option->max);
|
assert(option->max);
|
||||||
|
|
||||||
option->value.number = (number <= option->max) ? number : option->min;
|
option->value.number = (number <= option->max) ? number : option->min;
|
||||||
option_changed(ses, option, option);
|
option_changed(ses, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -1011,11 +1011,11 @@ call_change_hooks(struct session *ses, struct option *current, struct option *op
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
option_changed(struct session *ses, struct option *current, struct option *option)
|
option_changed(struct session *ses, struct option *option)
|
||||||
{
|
{
|
||||||
option->flags |= OPT_TOUCHED;
|
option->flags |= OPT_TOUCHED;
|
||||||
/* Notify everyone out there! */
|
/* Notify everyone out there! */
|
||||||
call_change_hooks(ses, current, option);
|
call_change_hooks(ses, option, option);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -180,8 +180,7 @@ void call_change_hooks(struct session *ses, struct option *current,
|
|||||||
|
|
||||||
/* Do proper bookkeeping after an option has changed - call this every time
|
/* Do proper bookkeeping after an option has changed - call this every time
|
||||||
* you change an option value. */
|
* you change an option value. */
|
||||||
void option_changed(struct session *ses, struct option *current,
|
void option_changed(struct session *ses, struct option *option);
|
||||||
struct option *option);
|
|
||||||
|
|
||||||
extern int commit_option_values(struct option_resolver *resolvers,
|
extern int commit_option_values(struct option_resolver *resolvers,
|
||||||
struct option *root,
|
struct option *root,
|
||||||
|
@ -775,7 +775,7 @@ setup_first_session(struct session *ses, struct uri *uri)
|
|||||||
if (!get_opt_bool("config.saving_style_w")) {
|
if (!get_opt_bool("config.saving_style_w")) {
|
||||||
struct option *opt = get_opt_rec(config_options, "config.saving_style_w");
|
struct option *opt = get_opt_rec(config_options, "config.saving_style_w");
|
||||||
opt->value.number = 1;
|
opt->value.number = 1;
|
||||||
option_changed(ses, opt, opt);
|
option_changed(ses, opt);
|
||||||
if (get_opt_int("config.saving_style") != 3) {
|
if (get_opt_int("config.saving_style") != 3) {
|
||||||
info_box(term, 0,
|
info_box(term, 0,
|
||||||
N_("Warning"), ALIGN_CENTER,
|
N_("Warning"), ALIGN_CENTER,
|
||||||
|
@ -1400,7 +1400,7 @@ text_typeahead_handler(struct input_line *line, int action_id)
|
|||||||
|
|
||||||
opt->value.number = (opt->value.number + 1)
|
opt->value.number = (opt->value.number + 1)
|
||||||
% (opt->max + 1);
|
% (opt->max + 1);
|
||||||
option_changed(ses, opt, opt);
|
option_changed(ses, opt);
|
||||||
}
|
}
|
||||||
/* Fall thru */
|
/* Fall thru */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user