Fix about compareServiceData processing in getAppServiceUri()
authorTaejeong Lee <taejeong.lee@samsung.com>
Fri, 15 Feb 2013 03:45:17 +0000 (12:45 +0900)
committerTaejeong Lee <taejeong.lee@samsung.com>
Fri, 15 Feb 2013 07:42:28 +0000 (16:42 +0900)
 * The comparing of scheme is wrong. it has compared with uri.

[Issue#] ORANGE-223
[Problem] appService launch leads to the wrong page
[Cause] The comparing of scheme is wrong.
[Solution] Fixed to compare with scheme properly.

Change-Id: I2cea2fe05c9f5ed99b94da52bba6b6d58961209f

src/view/common/view_logic_uri_support.cpp

index 6de0f46..eb08e75 100644 (file)
@@ -40,7 +40,7 @@ namespace {
 enum ServiceDataType
 {
     SERVICE_DATA_TYPE_OPERATION,
-    SERVICE_DATA_TYPE_URI,
+    SERVICE_DATA_TYPE_URI_SCHEME,
     SERVICE_DATA_TYPE_MIME,
     SERVICE_DATA_TYPE_MIME_ELEMENT
 };
@@ -88,7 +88,7 @@ bool compareServiceData(ServiceDataType type,
 {
     if (SERVICE_DATA_TYPE_OPERATION == type) {
         return origin == other;
-    } else if (SERVICE_DATA_TYPE_URI == type
+    } else if (SERVICE_DATA_TYPE_URI_SCHEME == type
                || SERVICE_DATA_TYPE_MIME_ELEMENT == type)
     {
         if (SERVICE_DATA_WILD_CHAR == origin) {
@@ -190,11 +190,15 @@ std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
     const char* value = NULL;
     value = appsvc_get_operation(bundle);
     std::string operation = value ? value : "";
-    value = appsvc_get_uri(bundle);
-    std::string scheme = value ? value : "";
+
     value = appsvc_get_mime(bundle);
     std::string mime = value ? value : "";
 
+    value = appsvc_get_uri(bundle);
+    std::string uri = value ? value : "";
+    std::vector<std::string> schemeParts = parseScheme(uri);
+    std::string scheme = (schemeParts.empty()) ? "" : schemeParts[0];
+
     LogDebug("operation : " << operation);
     LogDebug("schemeType : " << scheme);
     LogDebug("mimetype : " << mime);
@@ -205,7 +209,7 @@ std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
         if (compareServiceData(SERVICE_DATA_TYPE_OPERATION,
                                DPL::ToUTF8String(appServiceIt->operation),
                                operation) &&
-            compareServiceData(SERVICE_DATA_TYPE_URI,
+            compareServiceData(SERVICE_DATA_TYPE_URI_SCHEME,
                                DPL::ToUTF8String(appServiceIt->scheme),
                                scheme) &&
             compareServiceData(SERVICE_DATA_TYPE_MIME,
@@ -215,7 +219,7 @@ std::string getAppServiceUri(bundle *bundle, WidgetModel *widgetModel)
             return DPL::ToUTF8String(appServiceIt->src);
         }
     }
-    std::vector<std::string> schemeParts = parseScheme(scheme);
+
     if (schemeParts.size() > 1) {
         LogDebug("Scheme parts: " << schemeParts[0] << ", " << schemeParts[1]);
         return getCustomHandlerProtocolUri(