[SE][Ref.App][Tizen_3.0_Public_Final_RC1][Mobile][Email][MenuTree] Default ring tone... 34/101934/1
authorIgor Nazarov <i.nazarov@samsung.com>
Wed, 30 Nov 2016 14:06:41 +0000 (16:06 +0200)
committerIgor Nazarov <i.nazarov@samsung.com>
Wed, 30 Nov 2016 14:06:41 +0000 (16:06 +0200)
Change-Id: I7585f78127da3634154fc78ca11a533a69105201

modules/setting/src/email-view-notification.c

index 9781a70..423d6ba 100644 (file)
@@ -319,16 +319,7 @@ static void _alert_ringtone_setup_cb(void *data, Evas_Object *obj, void *event_i
 
        email_params_h params = NULL;
 
-       if (email_params_create(&params) &&
-               email_params_add_str(params, "marked_mode", marked_mode) &&
-               email_params_add_str(params, "path", SETTING_DEFAULT_ALERT_PATH) &&
-               email_params_add_str(params, "select_type", "SINGLE_FILE") &&
-               email_params_add_str(params, "file_type", "SOUND") &&
-               email_params_add_str(params, "title", "IDS_EMAIL_BODY_ALERT_RINGTONE_ABB") &&
-               email_params_add_str(params, "domain", PACKAGE) &&
-               email_params_add_str(params, "default", "default show") &&
-               email_params_add_str(params, "silent", "silent show") &&
-               email_params_add_str(params, "landscape", "support landscape")) {
+       if (email_params_create(&params)) {
 
                email_launched_app_listener_t listener = { 0 };
                listener.cb_data = li;
@@ -351,14 +342,22 @@ static void _ringtone_app_reply_cb(void *data, app_control_result_e result, emai
 
        EmailSettingView *view = li->view;
 
-       char *ringtone_file = NULL;
        const char *ringtone_path = NULL;
+       const char **ringtone_array = NULL;
+       int array_length = 0;
 
-       if (!email_params_get_str(reply, "result", &ringtone_path)) {
+       if (!email_params_get_str_array(reply, APP_CONTROL_DATA_SELECTED, &ringtone_array, &array_length)) {
                debug_warning("ringtone path result is NULL");
                return;
        }
 
+       if (array_length < 1) {
+               debug_warning("array_length: %d", array_length);
+               return;
+       }
+
+       ringtone_path = ringtone_array[0];
+
        debug_secure("ringtone_path: %s", ringtone_path);
        if (!g_strcmp0(MYFILE_DEFAULT_RINGTON_VALUE, ringtone_path)) {
                if (li->index == ALERT_RINGTONE_LIST_ITEM) {
@@ -373,9 +372,6 @@ static void _ringtone_app_reply_cb(void *data, app_control_result_e result, emai
                        view->account_data->options.alert_ringtone_path = strdup("");
                }
        } else {
-               ringtone_file = _get_alert_title(ringtone_path);
-               debug_secure("ringtone_file:%s", ringtone_file);
-
                if (li->index == ALERT_RINGTONE_LIST_ITEM) {
                        view->account_data->options.default_ringtone_status = 0;
                        FREE(view->account_data->options.alert_ringtone_path);
@@ -384,7 +380,6 @@ static void _ringtone_app_reply_cb(void *data, app_control_result_e result, emai
        }
 
        elm_genlist_item_update(li->it);
-       FREE(ringtone_file);
 
        _update_account_info(view);
 }