conf2 option ctx now stores update text to allow ignoring repeated updates, also remove tags from search lists when aliases are added

SVN revision: 83179
This commit is contained in:
Mike Blumenkrantz 2013-01-23 14:58:54 +00:00
parent 2792afd090
commit 88ea7b1e96
2 changed files with 15 additions and 1 deletions

View File

@ -2578,10 +2578,18 @@ e_configure_option_ctx_update(E_Configure_Option_Ctx *ctx, const char *str)
if ((!ctx->tags) && (ctx->opts)) return EINA_FALSE;
ctx->tags = eina_list_free(ctx->tags);
ctx->opts = eina_list_free(ctx->opts);
E_FREE(ctx->text);
return ctx->changed = EINA_TRUE;
}
update = strdupa(str);
update = strdup(str);
eina_str_tolower(&update);
if (!e_util_strcmp(ctx->text, update))
{
free(update);
return EINA_FALSE;
}
free(ctx->text);
ctx->text = update;
alist = eina_list_clone(tags_alias_list);
tlist = eina_list_clone(tags_list);
for (s = e = strdupa(update); e[0]; e++)
@ -2606,10 +2614,12 @@ e_configure_option_ctx_update(E_Configure_Option_Ctx *ctx, const char *str)
if (strncmp(s, alias, e - s))
{
tmp = eina_list_append(tmp, tag);
tlist = eina_list_remove(tlist, tag);
continue;
}
tmp = eina_list_free(tmp);
tmp = eina_list_append(tmp, tag);
tlist = eina_list_remove(tlist, tag);
skip = EINA_TRUE;
break;
}
@ -2657,10 +2667,12 @@ end:
if (strncmp(s, alias, e - s))
{
tmp = eina_list_append(tmp, tag);
tlist = eina_list_remove(tlist, tag);
continue;
}
tmp = eina_list_free(tmp);
tmp = eina_list_append(tmp, tag);
tlist = eina_list_remove(tlist, tag);
skip = EINA_TRUE;
break;
}
@ -2791,6 +2803,7 @@ e_configure_option_ctx_free(E_Configure_Option_Ctx *ctx)
eina_list_free(ctx->tags);
eina_list_free(ctx->opts);
eina_list_free(ctx->match_tags);
free(ctx->text);
free(ctx);
}

View File

@ -119,6 +119,7 @@ struct E_Configure_Option_Ctx
Eina_List *match_tags; // Eina_Stringshare
Eina_List *opts; // E_Configure_Option
Eina_Stringshare *category;
char *text;
Eina_Bool changed : 1;
};