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
This commit is contained in:
Yeongjong Lee 2019-03-26 13:16:32 +09:00 committed by Hermet Park
parent 18349ac73f
commit 43b199aca3
3 changed files with 24 additions and 1 deletions

View File

@ -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)
{

View File

@ -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; }

View File

@ -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);
}