hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=0a64eab88b711d1fdf7e03c6f4514a443b47e4fe

commit 0a64eab88b711d1fdf7e03c6f4514a443b47e4fe
Author: Mykyta Biliavskyi <m.biliavs...@samsung.com>
Date:   Fri Sep 4 15:39:00 2015 +0900

    Candidate list: filter the generated program names.
    
    Summary:
    for cases when candidate list contain
    names of programs, all generated names will be
    ignored.
    The generated name is started with: "program_0x" - template.
    
    Reviewers: Hermet
    
    Differential Revision: https://phab.enlightenment.org/D2970
---
 src/lib/ctxpopup.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/lib/ctxpopup.c b/src/lib/ctxpopup.c
index 71d7e88..d507d70 100644
--- a/src/lib/ctxpopup.c
+++ b/src/lib/ctxpopup.c
@@ -470,6 +470,9 @@ image_candidate_set(Evas_Object *ctxpopup, ctxpopup_data 
*ctxdata)
 static Eina_Bool
 program_candidate_set(Evas_Object *ctxpopup, ctxpopup_data *ctxdata)
 {
+   const char *PROGRAM_GEN = "program_0x";
+   int PROGRAM_GEN_LEN = 10;
+   int candidate_cntr = 0;
    view_data *vd = edj_mgr_view_get(NULL);
    if (!vd) return EINA_FALSE;
    Eina_List *parts = view_programs_list_get(vd);
@@ -477,13 +480,16 @@ program_candidate_set(Evas_Object *ctxpopup, 
ctxpopup_data *ctxdata)
    char *part;
    EINA_LIST_FOREACH(parts, l, part)
      {
+        if (!strncmp(part, PROGRAM_GEN, PROGRAM_GEN_LEN))
+           continue;
         snprintf(ctxdata->candidate, sizeof(ctxdata->candidate), "\"%s\"",
                  part);
         elm_ctxpopup_item_append(ctxpopup, ctxdata->candidate, NULL,
                                  ctxpopup_it_cb, ctxdata);
+        candidate_cntr++;
      }
    view_string_list_free(parts);
-   return EINA_TRUE;
+   return candidate_cntr ? EINA_TRUE : EINA_FALSE;
 }
 
 static Eina_Bool

-- 


Reply via email to