hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=43b199aca322a2774d72d7a3b6ad8f898914978e

commit 43b199aca322a2774d72d7a3b6ad8f898914978e
Author: Yeongjong Lee <yj34....@samsung.com>
Date:   Tue Mar 26 13:16:32 2019 +0900

    elm_photocam: fix file_get,set operations
    
    Summary: This patch fixes bug that elm_photocam_file_get always return NULL.
    
    Test Plan: make check
    
    Reviewers: Hermet, zmike, bu5hm4n
    
    Reviewed By: Hermet
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D8472
---
 src/lib/elementary/efl_ui_image_zoomable.c  |  6 ++++++
 src/lib/elementary/efl_ui_image_zoomable.eo |  2 +-
 src/tests/elementary/elm_test_photocam.c    | 17 +++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/lib/elementary/efl_ui_image_zoomable.c 
b/src/lib/elementary/efl_ui_image_zoomable.c
index 0dac500500..0f68d709b2 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -2408,6 +2408,12 @@ _efl_ui_image_zoomable_efl_file_file_set(Eo *obj 
EINA_UNUSED, Efl_Ui_Image_Zooma
    return 0;
 }
 
+EOLIAN static const char *
+_efl_ui_image_zoomable_efl_file_file_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Image_Zoomable_Data *sd)
+{
+   return sd->file;
+}
+
 EOLIAN static void
 _efl_ui_image_zoomable_efl_ui_zoom_zoom_level_set(Eo *obj, 
Efl_Ui_Image_Zoomable_Data *sd, double zoom)
 {
diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo 
b/src/lib/elementary/efl_ui_image_zoomable.eo
index ffaef70554..fccf57f21c 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.eo
+++ b/src/lib/elementary/efl_ui_image_zoomable.eo
@@ -64,7 +64,7 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image 
implements Efl.Ui.Zoom,
       Efl.Ui.Scrollable_Interactive.scroll;
       Efl.Access.Widget.Action.elm_actions { get; }
       Efl.File.load;
-      Efl.File.file { set; }
+      Efl.File.file { get; set; }
       Efl.Orientation.orientation { get; set; }
       Efl.Orientation.flip { get; set; }
       Efl.Layout.Group.group_size_min { get; }
diff --git a/src/tests/elementary/elm_test_photocam.c 
b/src/tests/elementary/elm_test_photocam.c
index b2bf4ecc12..8313fdb0d2 100644
--- a/src/tests/elementary/elm_test_photocam.c
+++ b/src/tests/elementary/elm_test_photocam.c
@@ -41,8 +41,25 @@ EFL_START_TEST(elm_atspi_role_get)
 }
 EFL_END_TEST
 
+EFL_START_TEST(elm_photocam_file)
+{
+   Evas_Object *win, *photocam;
+   const char *buf = ELM_IMAGE_DATA_DIR "/images/logo_small.png";
+
+   win = win_add(NULL, "photocam", ELM_WIN_BASIC);
+   photocam = elm_photocam_add(win);
+
+   ck_assert_int_eq(elm_photocam_file_set(photocam, buf), 
EVAS_LOAD_ERROR_NONE);
+   ck_assert_str_eq(elm_photocam_file_get(photocam), buf);
+
+   ck_assert_int_eq(elm_photocam_file_set(photocam, "non_existing.png"), 
EVAS_LOAD_ERROR_DOES_NOT_EXIST);
+   ck_assert_str_eq(elm_photocam_file_get(photocam), "non_existing.png");
+}
+EFL_END_TEST
+
 void elm_test_photocam(TCase *tc)
 {
    tcase_add_test(tc, elm_photocam_legacy_type_check);
    tcase_add_test(tc, elm_atspi_role_get);
+   tcase_add_test(tc, elm_photocam_file);
 }

-- 


Reply via email to