Fix App-control Supports
authorTaejeong Lee <taejeong.lee@samsung.com>
Wed, 6 Mar 2013 07:25:32 +0000 (16:25 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 6 Mar 2013 11:51:53 +0000 (20:51 +0900)
 * wrt-installer : Some parser related app-control was changed.
                   'file' sheme is not handled on parsing any more.

[Issue#]   N/A
[Bug]      Tizen app-control service doesn't works peroperly on wrt.
[Cause]    App-control info DB registeration routine was omitted.
[Solution] Registration routine was added.

Change-Id: I6c7a97ab82651500f31c94c067259437b3e86092

src/configuration_parser/widget_parser.cpp

index 7dc58aa..3b0a0ec 100644 (file)
@@ -1093,6 +1093,15 @@ class AppServiceParser : public ElementParser
         NormalizeString(m_scheme);
         NormalizeString(m_mime);
 
+        // exception
+        DPL::String ignoreUri(L"file");
+
+        if (!m_scheme.IsNull() && *m_scheme == ignoreUri)
+        {
+            LogInfo("exception : '" << *m_scheme << "' scheme will be ignored.");
+            m_scheme = DPL::OptionalString::Null;
+        }
+
         // verify duplicate element
         DPL::String wildString(L"*/*");
         DPL::String nullString(L"");
@@ -1271,15 +1280,22 @@ class AppControlParser : public ElementParser
 
         virtual void Verify()
         {
+            // exception
+            DPL::String ignoreUri(L"file");
+
+            if (!m_value.IsNull() && *m_value == ignoreUri)
+            {
+                LogInfo("exception : '" << *m_value << "' scheme will be ignored.");
+                m_value = DPL::OptionalString::Null;
+            }
+
             if (m_value.IsNull() || *m_value == L"") {
                 return;
             }
 
             DPL::String wildString(L"*/*");
-            if ((m_data.m_uriList.find(wildString) ==
-                 m_data.m_uriList.end())
-                && (m_data.m_uriList.find(*m_value) ==
-                    m_data.m_uriList.end()))
+            if ((m_data.m_uriList.find(wildString) == m_data.m_uriList.end())
+                && (m_data.m_uriList.find(*m_value) == m_data.m_uriList.end()))
             {
                 m_data.m_uriList.insert(*m_value);
             } else {
@@ -1402,16 +1418,6 @@ class AppControlParser : public ElementParser
             return;
         }
 
-        FOREACH(iterator, m_data.appControlList) {
-            if (iterator->m_src == m_appControl.m_src &&
-                iterator->m_operation == m_appControl.m_operation)
-            {
-                ThrowMsg(Exception::ParseError,
-                         "app control element is duplicated " +
-                         DPL::ToUTF8String(m_appControl.m_src) + ", " +
-                         DPL::ToUTF8String(m_appControl.m_operation));
-            }
-        }
         m_data.appControlList.push_back(m_appControl);
     }