summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2016-02-03 11:07:27 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2016-02-03 14:05:51 +0200
commitd5656fdd3d2abc7e8a1503ecebd915dce819c588 (patch)
tree6611bc9717ed0181e60eb3cdffd34443106e636e
parentba7bf818d88d3331781b055622842ef4a3943d7d (diff)
Elm.Genlist: Add small optimizations for filter and state cbs
-rw-r--r--efl/elementary/genlist.pxi8
1 files changed, 6 insertions, 2 deletions
diff --git a/efl/elementary/genlist.pxi b/efl/elementary/genlist.pxi
index d395297..2a2d78f 100644
--- a/efl/elementary/genlist.pxi
+++ b/efl/elementary/genlist.pxi
@@ -66,6 +66,8 @@ cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, cons
66 cdef: 66 cdef:
67 GenlistItem item = <GenlistItem>data 67 GenlistItem item = <GenlistItem>data
68 unicode u = _ctouni(part) 68 unicode u = _ctouni(part)
69 bint ret
70 Genlist o
69 71
70 func = item.item_class._state_get_func 72 func = item.item_class._state_get_func
71 if func is None: 73 if func is None:
@@ -78,12 +80,14 @@ cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, cons
78 traceback.print_exc() 80 traceback.print_exc()
79 return 0 81 return 0
80 82
81 return ret if ret is not None else 0 83 return ret
82 84
83cdef Eina_Bool _py_elm_genlist_item_filter_get(void *data, Evas_Object *obj, void *key) with gil: 85cdef Eina_Bool _py_elm_genlist_item_filter_get(void *data, Evas_Object *obj, void *key) with gil:
84 cdef: 86 cdef:
85 GenlistItem item = <GenlistItem>data 87 GenlistItem item = <GenlistItem>data
86 object pykey = <object>key 88 object pykey = <object>key
89 bint ret
90 Genlist o
87 91
88 func = item.item_class._filter_get_func 92 func = item.item_class._filter_get_func
89 if func is None: 93 if func is None:
@@ -96,7 +100,7 @@ cdef Eina_Bool _py_elm_genlist_item_filter_get(void *data, Evas_Object *obj, voi
96 traceback.print_exc() 100 traceback.print_exc()
97 return 0 101 return 0
98 102
99 return 1 if ret else 0 103 return ret
100 104
101cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil: 105cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil:
102 cdef GenlistItem item = <GenlistItem>data 106 cdef GenlistItem item = <GenlistItem>data