summaryrefslogtreecommitdiff
path: root/src/list.c
diff options
context:
space:
mode:
authorRadoslaw Czerski <r.czerski@samsung.com>2016-04-08 16:44:28 +0200
committerRadoslaw Czerski <r.czerski@samsung.com>2016-04-08 16:44:28 +0200
commita654132fb3a96511dfa4f5501f0f0550a5f279f0 (patch)
tree3cca54ec0c8d0379398232e4d24a1030e0670493 /src/list.c
parent86a96d732fda8b3f5d41ef1124c8a78da1159b49 (diff)
downloadshare-panel-a654132fb3a96511dfa4f5501f0f0550a5f279f0.tar.gz
share-panel-a654132fb3a96511dfa4f5501f0f0550a5f279f0.tar.bz2
share-panel-a654132fb3a96511dfa4f5501f0f0550a5f279f0.zip
'*/*' set as mime when no mime set.
Fix for TSAM-1712 Change-Id: I40eab4a9e041b513e8ccc8896a680e94f492c07f Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
Diffstat (limited to 'src/list.c')
-rw-r--r--src/list.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/list.c b/src/list.c
index d9d5deb..863f4eb 100644
--- a/src/list.c
+++ b/src/list.c
@@ -340,6 +340,25 @@ static void __make_applist(share_panel_h share_panel, Eina_List *matchlist, Eina
}
}
+static int check_mime(app_control_h control, char* operation_type)
+{
+ if (!strcmp(operation_type, APP_CONTROL_OPERATION_SHARE)
+ || !strcmp(operation_type, APP_CONTROL_OPERATION_MULTI_SHARE)) {
+ char *mime;
+ int ret = app_control_get_mime(control, &mime);
+ retvm_if(ret != APP_CONTROL_ERROR_NONE, FAIL, "app_control_get_mime failed[%d]", ret);
+ if (mime == NULL) {
+ ret = app_control_set_mime(control, "*/*");
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("app_control_set_mime failed[%d]", ret);
+ free(mime);
+ return FAIL;
+ }
+ }
+ free(mime);
+ }
+ return OK;
+}
Eina_List *_list_create(share_panel_h share_panel)
{
@@ -354,6 +373,8 @@ Eina_List *_list_create(share_panel_h share_panel)
app_control_get_operation(share_panel->control, &operation_type);
retv_if(!operation_type, NULL);
+ retv_if(check_mime(share_panel->control, operation_type) == FAIL, NULL);
+
__trim_uri(share_panel->control);
if (!strcmp(operation_type, APP_CONTROL_OPERATION_SHARE)