conf2 option ctx now stores update text to allow ignoring repeated updates, also...
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 23 Jan 2013 14:58:54 +0000 (14:58 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 23 Jan 2013 14:58:54 +0000 (14:58 +0000)
SVN revision: 83179

src/bin/e_configure_option.c
src/bin/e_configure_option.h

index 4f06189..b09a884 100644 (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);
 }
 
index dc342fb..9467268 100644 (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;
 };