From 8ac2c47d4032be832d84eeb102ad948cc3552998 Mon Sep 17 00:00:00 2001 From: Baptiste DURAND Date: Thu, 16 Jan 2014 16:22:59 +0100 Subject: [PATCH] Fix TIVI-2144 : current version of elementary 1.7 define the popup class type as "popup" instead of "elm_popup". Add define to allow the compilation with elementary 1.7.8 & 1.8.X Change-Id: I7acecc2495ff2d213e864b953b652763b788868d Signed-off-by: Baptiste DURAND --- src/view/common/view_logic_certificate_support.cpp | 10 ++++++++-- src/view/common/view_logic_security_origin_support.cpp | 11 +++++++++-- src/view/webkit/view_logic_usermedia_support.cpp | 9 ++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/view/common/view_logic_certificate_support.cpp b/src/view/common/view_logic_certificate_support.cpp index dea29fb..fe08186 100644 --- a/src/view/common/view_logic_certificate_support.cpp +++ b/src/view/common/view_logic_certificate_support.cpp @@ -36,6 +36,12 @@ #include #include +#if (ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 7) +#define POPUP_CLASSNAME "popup" +#else +//#if ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 8) +#define POPUP_CLASSNAME "elm_popup" +#endif namespace ViewModule { namespace { const double MAX_POPUP_HEIGHT = 0.80; @@ -219,7 +225,7 @@ Evas_Object* CertificateSupportUtil::getPopup(Evas_Object* button) Assert(button); Evas_Object* popup = button; - while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) { + while (strcmp(elm_object_widget_type_get(popup), POPUP_CLASSNAME)) { popup = elm_object_parent_widget_get(popup); if (!popup) { return NULL; @@ -231,7 +237,7 @@ Evas_Object* CertificateSupportUtil::getPopup(Evas_Object* button) Evas_Object* CertificateSupportUtil::getCheck(Evas_Object* popup) { Assert(popup); - if (strcmp(elm_object_widget_type_get(popup), "elm_popup")) { + if (strcmp(elm_object_widget_type_get(popup), POPUP_CLASSNAME)) { return NULL; } Evas_Object* check = elm_object_part_content_get( diff --git a/src/view/common/view_logic_security_origin_support.cpp b/src/view/common/view_logic_security_origin_support.cpp index baa4cde..e06115e 100644 --- a/src/view/common/view_logic_security_origin_support.cpp +++ b/src/view/common/view_logic_security_origin_support.cpp @@ -36,6 +36,13 @@ #include #include + +#if (ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 7) +#define POPUP_CLASSNAME "popup" +#else +//#if ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 8) +#define POPUP_CLASSNAME "elm_popup" +#endif namespace ViewModule { namespace { const double MAX_POPUP_HEIGHT = 0.80; @@ -214,7 +221,7 @@ Evas_Object* SecurityOriginSupportUtil::getPopup(Evas_Object* button) Assert(button); Evas_Object* popup = button; - while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) { + while (strcmp(elm_object_widget_type_get(popup), POPUP_CLASSNAME )) { popup = elm_object_parent_widget_get(popup); if (!popup) { return NULL; @@ -226,7 +233,7 @@ Evas_Object* SecurityOriginSupportUtil::getPopup(Evas_Object* button) Evas_Object* SecurityOriginSupportUtil::getCheck(Evas_Object* popup) { Assert(popup); - if (strcmp(elm_object_widget_type_get(popup), "elm_popup")) { + if (strcmp(elm_object_widget_type_get(popup), POPUP_CLASSNAME )) { return NULL; } Evas_Object* check = elm_object_part_content_get( diff --git a/src/view/webkit/view_logic_usermedia_support.cpp b/src/view/webkit/view_logic_usermedia_support.cpp index 7e1adde..cc5a76c 100755 --- a/src/view/webkit/view_logic_usermedia_support.cpp +++ b/src/view/webkit/view_logic_usermedia_support.cpp @@ -30,6 +30,13 @@ #include #include +#if (ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 7) +#define POPUP_CLASSNAME "popup" +#else +//#if ELM_VERSION_MAJOR == 1 && ELM_VERSION_MINOR == 8) +#define POPUP_CLASSNAME "elm_popup" +#endif + namespace ViewModule { using namespace SecurityOriginDB; using namespace ViewModule::SecurityOriginSupportUtil; @@ -68,7 +75,7 @@ Evas_Object* getPopup(Evas_Object* button) Assert(button); Evas_Object* popup = button; - while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) { + while (strcmp(elm_object_widget_type_get(popup), POPUP_CLASSNAME)) { popup = elm_object_parent_widget_get(popup); if (!popup) { return NULL; -- 2.7.4