From b03ecefa920d5909d09cb375866b4559bedbb915 Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Wed, 5 Aug 2015 18:11:09 +0900 Subject: [PATCH] getting caller from app_control instead of get parameter Change-Id: I1078db4b6ecbfd03c0597ca116d50579d84dc783 Signed-off-by: Minkyu Kang --- src/main.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main.c b/src/main.c index 8a4ecc8..a77128d 100644 --- a/src/main.c +++ b/src/main.c @@ -29,7 +29,7 @@ #define PARAM_MEDIA_ID "media_id" #define PARAM_SENDER_ID "sender_id" -#define SENDER_FAVORITE "Favorite" +#define APP_ID_FAVORITE "org.tizen.favorite" SET_TAG(PACKAGE) @@ -124,7 +124,7 @@ static void _app_control(app_control_h app_control, void *data) { struct _appdata *ad; char *media_id; - char *sender_id; + char *caller_id; int r; if (!data) { @@ -137,24 +137,23 @@ static void _app_control(app_control_h app_control, void *data) if (ad->win) elm_win_activate(ad->win); - r = app_control_get_extra_data(app_control, PARAM_MEDIA_ID, &media_id); + r = app_control_get_caller(app_control, &caller_id); if (r != APP_CONTROL_ERROR_NONE) - media_id = NULL; + caller_id = NULL; - r = app_control_get_extra_data(app_control, - PARAM_SENDER_ID, &sender_id); + r = app_control_get_extra_data(app_control, PARAM_MEDIA_ID, &media_id); if (r != APP_CONTROL_ERROR_NONE) - sender_id = NULL; + media_id = NULL; - if (media_id && sender_id) { - if (!strcmp(sender_id, SENDER_FAVORITE)) + if (media_id && caller_id) { + if (!strcmp(caller_id, APP_ID_FAVORITE)) viewmgr_update_view(VIEW_BASE, UPDATE_FAVORITE, media_id); } else viewmgr_push_view(VIEW_BASE); free(media_id); - free(sender_id); + free(caller_id); } static void _pause(void *data) -- 2.7.4