Fixed calendar appcontrol
authorHosang Kim <hosang.kim@samsung.com>
Thu, 18 Apr 2013 07:07:27 +0000 (16:07 +0900)
committerHosang Kim <hosang.kim@samsung.com>
Thu, 18 Apr 2013 07:07:52 +0000 (16:07 +0900)
Change-Id: I8b37c0facaf0d0c9ea110c8f9df2f23047531d30
Signed-off-by: Hosang Kim <hosang.kim@samsung.com>
src/calendar-app-control/CalendarAppControlDllEntry.cpp

index abb8fbc..6c16ed3 100644 (file)
@@ -67,6 +67,7 @@ static const char __allowedAppControlPickTable[][2][96] =
        {"osp.appcontrol.provider.calendar", "osp.appcontrol.operation.pick"},
        {"tizen.calendar", "http://tizen.org/appcontrol/operation/pick"},
        {"tizen.calendar", "http://tizen.org/appcontrol/operation/social/pick"},
+       {"tizen.todo", "http://tizen.org/appcontrol/operation/social/pick"},
 };
 
 static const char __allowedAppControlViewTable[][2][96] =
@@ -74,6 +75,7 @@ static const char __allowedAppControlViewTable[][2][96] =
        {"osp.appcontrol.CALENDAR", "osp.appcontrol.operation.VIEW"},
        {"osp.appcontrol.provider.calendar", "osp.appcontrol.operation.view"},
        {"tizen.calendar", "http://tizen.org/appcontrol/operation/social/view"},
+       {"tizen.todo", "http://tizen.org/appcontrol/operation/social/view"},
 };
 
 static const char __allowedAppControlEditTable[][2][96] =
@@ -84,6 +86,7 @@ static const char __allowedAppControlEditTable[][2][96] =
 static const char __allowedAppControlVcsViewTable[][2][96] =
 {
        {"tizen.calendar", "http://tizen.org/appcontrol/operation/view"},
+       {"tizen.todo", "http://tizen.org/appcontrol/operation/view"},
 };
 
 result
@@ -96,9 +99,9 @@ StartAppControl(int req, const String& aId, const String& oId, const String* pUr
 
        __req = req;
 
-       const bool isCalendarVcsView = _AppControlManager::IsAllowedAppControl(__allowedAppControlVcsViewTable, 1, aId, oId);
-       const bool isCalendarView = _AppControlManager::IsAllowedAppControl(__allowedAppControlViewTable, 3, aId, oId);
-       const bool isCalendarPick = _AppControlManager::IsAllowedAppControl(__allowedAppControlPickTable, 4, aId, oId);
+       const bool isCalendarVcsView = _AppControlManager::IsAllowedAppControl(__allowedAppControlVcsViewTable, 2, aId, oId);
+       const bool isCalendarView = _AppControlManager::IsAllowedAppControl(__allowedAppControlViewTable, 4, aId, oId);
+       const bool isCalendarPick = _AppControlManager::IsAllowedAppControl(__allowedAppControlPickTable, 5, aId, oId);
        const bool isCalendarEdit = _AppControlManager::IsAllowedAppControl(__allowedAppControlEditTable, 1, aId, oId);
 
        SysTryReturnResult(NID_APP, isCalendarPick || isCalendarEdit || isCalendarView || isCalendarVcsView, E_SYSTEM, "Invalid AppControl entry for (%ls, %ls).", aId.GetPointer(), oId.GetPointer());
@@ -199,7 +202,7 @@ StartAppControl(int req, const String& aId, const String& oId, const String* pUr
 
                        operation = L"http://tizen.org/appcontrol/operation/social/view";
 
-                       const String& tmpItemType = msg.GetValue(L"itemType");
+                       const String& tmpItemType = msg.GetValue(L"viewType");
                        if (!tmpItemType.IsEmpty())
                        {
                                msg.AddData(CALENDAR_ITEM_TYPE, tmpItemType);
@@ -213,10 +216,15 @@ StartAppControl(int req, const String& aId, const String& oId, const String* pUr
                                msg.AddData(CALENDAR_ITEM_TYPE, L"event");
                        }
 
-                       const String& tmp = msg.GetValue(L"eventId");
-                       if (!tmp.IsEmpty())
+                       const String& tmpEventId = msg.GetValue(L"eventId");
+                       const String& tmpTodoId = msg.GetValue(L"todoId");
+                       if (!tmpEventId.IsEmpty())
                        {
-                               msg.AddData(CALENDAR_ITEM_ID, tmp);
+                               msg.AddData(CALENDAR_ITEM_ID, tmpEventId);
+                       }
+                       else if (!tmpTodoId.IsEmpty())
+                       {
+                               msg.AddData(CALENDAR_ITEM_ID, tmpTodoId);
                        }
                }
        }