From 166bc315d0203334e24d1fe9e1eebb5c0fbf61d8 Mon Sep 17 00:00:00 2001 From: woochan lee Date: Tue, 17 Mar 2015 15:42:36 +0900 Subject: [PATCH] conform: Use eo_isa() to check object types. Summary: The strcmp(line 738) has been failed since the eo applied. the widget type get API returned "Elm_Genlist" now. For fix it, using eo_isa() to check object types instead of string comparison. @fix Reviewers: seoz, woohyun, JackDanielZ, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2148 --- src/lib/elm_conform.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/lib/elm_conform.c b/src/lib/elm_conform.c index 13e95af..741a846 100644 --- a/src/lib/elm_conform.c +++ b/src/lib/elm_conform.c @@ -18,11 +18,6 @@ static char CONFORMANT_KEY[] = "_elm_conform_key"; #define ELM_CONFORM_INDICATOR_TIME 1.0 -#ifdef HAVE_ELEMENTARY_X -#define SUB_TYPE_COUNT 2 -static char *sub_type[SUB_TYPE_COUNT] = { "elm_scroller", "elm_genlist" }; -#endif - static const char INDICATOR_PART[] = "elm.swallow.indicator"; static const char VIRTUALKEYPAD_PART[] = "elm.swallow.virtualkeypad"; static const char CLIPBOARD_PART[] = "elm.swallow.clipboard"; @@ -731,15 +726,11 @@ _autoscroll_objects_update(void *data) while (sub) { - type = elm_widget_type_get(sub); - if (!strcmp(type, MY_CLASS_NAME_LEGACY)) break; + if (eo_isa(sub, ELM_CONFORMANT_CLASS)) break; + + if (eo_isa(sub, ELM_SCROLLER_CLASS) || eo_isa(sub, ELM_GENLIST_CLASS)) + top_scroller = sub; - for (i = 0; i < SUB_TYPE_COUNT; i++) - if (!strcmp(type, sub_type[i])) - { - top_scroller = sub; - break; - } sub = elm_object_parent_widget_get(sub); } -- 2.7.4