Remove unused variables
[platform/core/uifw/inputdelegator.git] / src / w-input-selector.cpp
index ed22ea2..d72a097 100755 (executable)
@@ -210,7 +210,6 @@ static void _keyboard_clicked_cb(void *data, Evas_Object * obj, void *event_info
 
 static void __ise_smartreply_gl_sel(void *data, Evas_Object *obj, void *event_info)
 {
-       App_Data* app_data = (App_Data*) data;
        Elm_Object_Item *item = (Elm_Object_Item *) event_info;
 
        if (item) {
@@ -842,7 +841,6 @@ unsigned int _update_smartreply_items(void *user_data)
 
        Elm_Object_Item *first;
        Elm_Object_Item *menu;
-       Elm_Object_Item *pos;
 
        unsigned int i = 0;
        unsigned int len = 0;
@@ -883,8 +881,6 @@ unsigned int _update_smartreply_items(void *user_data)
                itc->func.state_get = NULL;
                itc->func.del = NULL;
 
-               pos = menu;
-
                for (i = 0; i < len; i++) {
                        char *reply = "hello";
                        unsigned int j;
@@ -898,7 +894,6 @@ unsigned int _update_smartreply_items(void *user_data)
                                continue;
                        PRINTFUNC(DLOG_DEBUG, "SmartReply = [%d]%s", i, reply);
 
-
                        for (j = 0; j < template_list.size(); j++) {
                                const char *template_str;
 
@@ -916,7 +911,7 @@ unsigned int _update_smartreply_items(void *user_data)
                        if (matched == true)
                                continue;
 
-                       pos = elm_genlist_item_append(app_data->genlist,
+                       elm_genlist_item_append(app_data->genlist,
                                                itc,
                                                (void *)(uintptr_t)i,
                                                NULL,
@@ -1113,9 +1108,39 @@ void _app_service(app_control_h service, void* user_data)
        char **input_type_array = NULL;
        int input_type_array_len = -1;
        bool is_extra_data_array = false;
+       char *mime_type = NULL;
 
        app_control_clone(&(app_data->source_app_control), service);
        app_data->reply_type = REPLY_APP_NORMAL;
+       app_data->mime_type = MIME_TYPE_ALL;
+
+       ret = app_control_get_mime(service, &mime_type);
+       if (ret != APP_CONTROL_ERROR_NONE) {
+               LOGD("Fail to get mime type : %d", ret);
+       } else {
+               if (mime_type) {
+                       LOGD("mime type = %s", mime_type);
+                       if (!strncmp(mime_type, "image/", strlen("image/"))) {
+                               app_data->mime_type = MIME_TYPE_IMAGE;
+                               app_data->app_type = APP_TYPE_DRAWING;
+                               launch_drawing_app((void *)app_data);
+                               if (mime_type)
+                                       free(mime_type);
+                               goto ACTIVATE;
+                       } else if(!strncmp(mime_type, "audio/", strlen("audio/"))) {
+                               app_data->mime_type = MIME_TYPE_AUDIO;
+                               app_data->app_type = APP_TYPE_STT;
+                               _stt_clicked_cb((void *)app_data, NULL, NULL);
+                               if (mime_type)
+                                       free(mime_type);
+                               goto ACTIVATE;
+                       } else if(!strncmp(mime_type, "text/", strlen("text/"))) {
+                               app_data->mime_type = MIME_TYPE_TEXT;
+                       }
+               }
+       }
+       if (mime_type)
+               free(mime_type);
 
        if (_TV || _MOBILE) {
                app_data->app_type = APP_TYPE_KEYBOARD;