diff options
-rwxr-xr-x | CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/setting-clock.c | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c8f060..9e27839 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ SET(FAKE_IMG_PATH "${TZ_SYS_RO_APP}/${PKGNAME}/shared/res") SET(CHANGEABLE_PATH "${PREFIX}/shared/res/tables") #ENDIF(FEATURE_SETTING_CHANGEABLE) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Werror") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Werror=pointer-to-int-cast -Werror=int-to-pointer-cast") IF(FEATURE_SETTING_SDK) diff --git a/src/setting-clock.c b/src/setting-clock.c index d703aeb..8efed45 100644 --- a/src/setting-clock.c +++ b/src/setting-clock.c @@ -123,6 +123,17 @@ static char *font_size_str[] = { "IDS_ST_BODY_LARGE_M_FONT_SIZE_ABB2" }; +static char *bg_path_str[] = { + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_00.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_01.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_02.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_03.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_04.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_05.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_06.png", + SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_07.png" +}; + enum { CLOCK_TITLE_CLOCK, CLOCK_TITLE_LANGUAGE, @@ -860,9 +871,7 @@ static void _bg_mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *even if (bg_touch_mode == TOUCH_MOVE) return; - int img_idx = (int)data; - char img_path[512] = {0}; - snprintf(img_path, 511, SETTING_HOME_SCREEN_DIR_PATH"/BG_preview_%02d.png",img_idx); + char* img_path = (char*)data; bg_prev_x = 0; bg_touch_mode = NONE; @@ -1018,7 +1027,7 @@ static Evas_Object *_create_background_index(Evas_Object *parent, void *data) /* touch event */ evas_object_event_callback_add(page, EVAS_CALLBACK_MOUSE_DOWN, _bg_mouse_down_cb, NULL); - evas_object_event_callback_add(page, EVAS_CALLBACK_MOUSE_UP, _bg_mouse_up_cb, (void *)i); + evas_object_event_callback_add(page, EVAS_CALLBACK_MOUSE_UP, _bg_mouse_up_cb, bg_path_str[i]); evas_object_event_callback_add(page, EVAS_CALLBACK_MOUSE_MOVE, _bg_mouse_move_cb, NULL); elm_object_part_content_set(clock_layout, "clock-image", page); |