aboutsummaryrefslogtreecommitdiffstats
path: root/extcap_parser.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-29 07:57:36 +0100
committerRoland Knall <rknall@gmail.com>2016-02-01 12:12:41 +0000
commit927ffaa794d5fb24e0b4f3fba08c4c31f4dd7d63 (patch)
tree70676d0b7e00e0b10678d0f7f3ff7dd707eabcd2 /extcap_parser.c
parent5e89f9332228015c3e5c813939bf35dbcc5a105d (diff)
extcap: Add Save functionality to options dialog
This patch creates the functionality of saving all parameters for extcap devices in the general preference section. For now, multiselect and fileselect do not save their values but patches for this will be provided in the future Also, all preferences are stored as strings to make handling easier. This might change in the future, but for the first version it will stick. Restore to Defaults is not implemented as of yet, and will be in a future version, once the preference storing is finalized Bug: 11666 Change-Id: I178346405146d2e43f4f3481c05c92c0b3595af5 Reviewed-on: https://code.wireshark.org/review/13451 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap_parser.c')
-rw-r--r--extcap_parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/extcap_parser.c b/extcap_parser.c
index 37c0e70728..652d7dde14 100644
--- a/extcap_parser.c
+++ b/extcap_parser.c
@@ -353,6 +353,7 @@ void extcap_free_arg(extcap_arg *a) {
g_free(a->tooltip);
g_free(a->fileextension);
g_free(a->regexp);
+ g_free(a->storeval);
if (a->range_start != NULL)
extcap_free_complex(a->range_start);
@@ -404,6 +405,7 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
if (sent == EXTCAP_SENTENCE_ARG) {
target_arg = g_new0(extcap_arg, 1);
target_arg->arg_type = EXTCAP_ARG_UNKNOWN;
+ target_arg->save = TRUE;
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_ARGNUM))
== NULL) {
@@ -489,7 +491,7 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
} else if (g_ascii_strcasecmp(v->value, "password") == 0) {
target_arg->arg_type = EXTCAP_ARG_PASSWORD;
/* default setting is to not save passwords */
- target_arg->do_not_save = TRUE;
+ target_arg->save = FALSE;
} else if (g_ascii_strcasecmp(v->value, "fileselect") == 0) {
target_arg->arg_type = EXTCAP_ARG_FILESELECT;
} else if (g_ascii_strcasecmp(v->value, "multicheck") == 0) {
@@ -502,7 +504,7 @@ extcap_arg *extcap_parse_arg_sentence(GList * args, extcap_token_sentence *s) {
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_SAVE))
!= NULL) {
- target_arg->do_not_save = ! g_regex_match_simple(EXTCAP_BOOLEAN_REGEX, v->value, G_REGEX_CASELESS, (GRegexMatchFlags)0 );
+ target_arg->save = g_regex_match_simple(EXTCAP_BOOLEAN_REGEX, v->value, G_REGEX_CASELESS, (GRegexMatchFlags)0 );
}
if ((v = extcap_find_param_by_type(s->param_list, EXTCAP_PARAM_RANGE))