enable appgadget
authorJisung Ahn <jcastle.ahn@samsung.com>
Sat, 19 Jan 2013 04:17:23 +0000 (13:17 +0900)
committerJisung Ahn <jcastle.ahn@samsung.com>
Sat, 19 Jan 2013 04:46:02 +0000 (13:46 +0900)
Change-Id: I19a93f928edc06c4ddb8972e574f97f594470c47

main/src/control/ivug-parameter.c

index be01729..61a01bc 100755 (executable)
@@ -312,16 +312,6 @@ ivug_param_create_from_bundle(service_h service)
        _print_service_data(service);
        MSG_IVUG_HIGH("**********************************");
 
-       /*char *path = NULL;
-       service_get_uri(service, &path);        // app gadget
-       if(path)
-       {
-               MSG_IMAGEVIEW_ERROR("App gadget launched %s", path);
-               service_add_extra_data (service, "Path", path);
-               service_add_extra_data (service, "View Mode", "SINGLE");
-               _ivug_free(&path);
-       }*/
-
        //parsing param
        ivug_parameter* data = (ivug_parameter*)calloc(1, sizeof(ivug_parameter));
 
@@ -345,6 +335,40 @@ ivug_param_create_from_bundle(service_h service)
                data->bStandalone = false;
        }
 
+       //parse path
+       char* szFilePath = NULL;
+       {
+               service_get_extra_data (service, IVUG_BUNDLE_KEY_PATH, &szFilePath);
+               if(szFilePath == NULL)
+               {
+                       MSG_IVUG_ERROR("File path is NULL");
+                       service_get_uri(service, &szFilePath);  // app gadget
+                       if(szFilePath)
+                       {
+                               MSG_IMAGEVIEW_ERROR("App gadget launched %s", szFilePath);
+                               service_add_extra_data (service, "View Mode", "SINGLE");
+                       }
+               }
+               if ( szFilePath != NULL )
+               {
+                       if(strncmp(IVUG_FILE_PREFIX, szFilePath, strlen(IVUG_FILE_PREFIX)) == 0)
+                       {
+                               data->filepath = strdup(szFilePath + strlen(IVUG_FILE_PREFIX));
+                       }
+                       else
+                       {
+                               data->filepath = strdup(szFilePath);
+                       }
+                       MSG_IVUG_MED("Current File = %s", data->filepath);
+                       _ivug_free(&szFilePath);
+               }
+               else
+               {
+                       ivug_param_delete(data);
+                       return NULL;
+               }
+       }
+
 // View By
        char* szViewBy = NULL;
 
@@ -435,33 +459,6 @@ ivug_param_create_from_bundle(service_h service)
                MSG_IVUG_HIGH("View mode is NULL. Set Default(%d)", data->mode);
        }
 
-//parse path
-       char* szFilePath = NULL;
-
-       {
-               service_get_extra_data (service, IVUG_BUNDLE_KEY_PATH, &szFilePath);
-               if ( szFilePath != NULL )
-               {
-                       if(strncmp(IVUG_FILE_PREFIX, szFilePath, strlen(IVUG_FILE_PREFIX)) == 0)
-                       {
-                               data->filepath = strdup(szFilePath + strlen(IVUG_FILE_PREFIX));
-                       }
-                       else
-                       {
-                               data->filepath = strdup(szFilePath);
-                       }
-                       MSG_IVUG_MED("Current File = %s", data->filepath);
-                       _ivug_free(&szFilePath);
-               }
-               else
-               {
-                       MSG_IVUG_ERROR("File path is NULL");
-
-                       ivug_param_delete(data);
-                       return NULL;
-               }
-       }
-
        //parse album id -album id is cluster id of media service
        service_get_extra_data (service, IVUG_BUNDLE_KEY_ALBUM_IDX, &val);
        if(val && data->view_by != IVUG_VIEW_BY_ALL)