Update change log and spec for wrt-plugins-tizen_0.4.22
authorDongjin Choi <milkelf.choi@samsung.com>
Mon, 22 Apr 2013 08:13:50 +0000 (17:13 +0900)
committerDongjin Choi <milkelf.choi@samsung.com>
Mon, 22 Apr 2013 08:21:02 +0000 (17:21 +0900)
[model] REDWOOD
[binary_type] PDA
[customer] OPEN

[Issue#] N/A
[Problem] To send exception is not same as widl.
[Cause] N/A
[Solution] Modified to be same as sending exceptios according widl

[Issue#] N/A
[Problem] Don't post notification when not set application Control param.
[Cause] side effect of TCT. if Application Control is null, exception exception.
[Solution] inserted checking statement of Appliclation Control Value.

[team] WebAPI
[request] N/A
[horizontal_expansion] N/A

packaging/wrt-plugins-tizen.spec
src/Bookmark/BookmarkManager.cpp
src/DataControl/JSSelectObjectArrayValues.cpp
src/DataControl/MappedDataControlConsumer.cpp
src/DataControl/SelectDataObject.cpp
src/DataControl/SqlDataControlConsumer.cpp
src/Notification/JSStatusNotification.cpp

index fa98f9e..c30515e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       wrt-plugins-tizen
 Summary:    JavaScript plugins for WebRuntime
-Version:    0.4.21
+Version:    0.4.22
 Release:    0
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 657f7aa..5b37002 100755 (executable)
@@ -114,7 +114,7 @@ std::vector<BookmarkDataPtr> BookmarkManager::get(BookmarkSearchDataPtr &searchD
                        if (result == FAVORITES_ERROR_NONE)
                                return _getCompleteCB(searchData);
                        else if (result == FAVORITES_ERROR_DB_FAILED)
-                               throw IOException("DB Failed");
+                               throw UnknownException("DB Failed");
                        else
                                throw UnknownException("Unknown Error");
                }
@@ -194,7 +194,7 @@ int BookmarkManager::add(bookmarkType type, const int parent_id, const std::stri
        else if (result == FAVORITES_ERROR_INVALID_PARAMETER)
                throw InvalidValuesException("Wrong parameter");
        else if (result == FAVORITES_ERROR_DB_FAILED)
-               throw IOException("DB Failed");
+               throw UnknownException("DB Failed");
        else if (result == FAVORITES_ERROR_NO_SUCH_FILE)
                throw NotFoundException("Can't find the parent folder");
        else
@@ -209,24 +209,29 @@ void BookmarkManager::remove(BookmarkSearchDataPtr &searchData) {
        else if ((searchData->m_bookmark)->m_type == BOOKMARKITEM_TYPE)
                result = favorites_bookmark_delete_bookmark((searchData->m_bookmark)->m_id);
        else {
-               result = favorites_bookmark_foreach(favorites_bookmark_foreach_cb, searchData.get());
-               if (result == FAVORITES_ERROR_NONE) {
-                       std::vector<BookmarkDataPtr> deletebookmarks = _getCompleteCB(searchData);
-                       result = favorites_bookmark_delete_bookmark((searchData->m_bookmark)->m_id);
+               try {
+                       result = favorites_bookmark_foreach(favorites_bookmark_foreach_cb, searchData.get());
                        if (result == FAVORITES_ERROR_NONE) {
-                               for (std::size_t i = 0; i < deletebookmarks.size(); ++i) {
-                                       result = favorites_bookmark_delete_bookmark(deletebookmarks[i]->m_id);
-                                       if (result != FAVORITES_ERROR_NONE)
-                                               break;
+                               std::vector<BookmarkDataPtr> deletebookmarks = _getCompleteCB(searchData);
+                               result = favorites_bookmark_delete_bookmark((searchData->m_bookmark)->m_id);
+                               if (result == FAVORITES_ERROR_NONE) {
+                                       for (std::size_t i = 0; i < deletebookmarks.size(); ++i) {
+                                               result = favorites_bookmark_delete_bookmark(deletebookmarks[i]->m_id);
+                                               if (result != FAVORITES_ERROR_NONE)
+                                                       break;
+                                       }
                                }
                        }
+               } catch( const NotFoundException& err) {
+                       LogDebug("Not Found");
+                       return;
                }
        }
 
        if (result == FAVORITES_ERROR_NONE)
                return;
        else if (result == FAVORITES_ERROR_DB_FAILED)
-               throw IOException("DB Failed");
+               throw UnknownException("DB Failed");
        else
                throw UnknownException("Unknown Error");                
 }
index e6eeb17..ac4cf4d 100755 (executable)
@@ -167,7 +167,7 @@ bool JSSelectObjectArrayValues::hasProperty(JSContextRef context,
                }
                
                DataControlConverter converter(priv->getContext());
-               size_t index = converter.toSizeT(propertyName);
+               int index = converter.toSizeT(propertyName);
 
                LogDebug(index);
                ISelectDataObjectPtr SelectDataOjbect = priv->getObject();
index c921d3a..b2b58f5 100755 (executable)
@@ -72,7 +72,7 @@ static std::vector<std::string> getDataArrayFromBundle(bundle *b, std::string ke
        std::vector<std::string> result;
        const char **array;
        int length = 0;
-       size_t index = 0;
+       int index = 0;
        
        array = appsvc_get_data_array(b, key.c_str(), &length);
 
@@ -98,7 +98,7 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv
        MappedDataControlConsumer *consumer = NULL;
        EventGetValuePtr event;
        int count = 0;
-       int index = 0;
+       size_t index = 0;
 
        try 
        {
@@ -118,7 +118,7 @@ static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsv
                }
                std::vector<std::string> result = getDataArrayFromBundle(b, OSP_K_ARG);
 
-               for (size_t index = 0; index < result.size(); index++)
+               for (index = 0; index < result.size(); index++)
                {
                        LogDebug(result[index]);
                }
index dbb80b5..926e569 100755 (executable)
@@ -92,7 +92,7 @@ void SelectDataObject::OnRequestReceived(const EventGetIndexedRowPtr& event)
                int type = 0;
                int rowIndex = event->getIndex();
                // move stream to current index
-               size_t index = 0;
+               int index = 0;
                
                std::vector<std::string> keys, values;
                std::string data;       
@@ -109,7 +109,7 @@ void SelectDataObject::OnRequestReceived(const EventGetIndexedRowPtr& event)
 
                m_istream.seekg(dataStart, std::ios::beg);
                
-               for (index = 0; index < m_headerInfo.size(); index++)
+               for (index = 0; index < (int)m_headerInfo.size(); index++)
                {
                        keys.push_back(m_headerInfo[index].m_name);
                }
@@ -227,7 +227,7 @@ void SelectDataObject::loadHeader()
        m_istream.read((char*)&m_colCount, sizeof(int));
        m_istream.read((char*)&m_colTotalSize, sizeof(int));
 
-       size_t index = 0, j = 0;
+       int index = 0, j = 0;
        char c;
 
        for (index = 0; index < m_colCount; index++)
@@ -274,7 +274,7 @@ void SelectDataObject::printHeader()
 void SelectDataObject::moveOneRow()
 {
        int size = 0;
-       size_t index = 0;
+       int index = 0;
 
        if (m_istream.good() == false)
                LogDebug("Error");
index 131a283..5d6e50f 100755 (executable)
@@ -73,7 +73,7 @@ static std::vector<std::string> getDataArrayFromBundle(bundle *b, std::string ke
        std::vector<std::string> result;
        const char **array;
        int length = 0;
-       size_t index = 0;
+       int index = 0;
        
        array = appsvc_get_data_array(b, key.c_str(), &length);
 
index 64743c2..7e1aa9e 100755 (executable)
@@ -623,7 +623,8 @@ StatusNotification* JSStatusNotification::getPrivateObject(JSContextRef context,
 
     // appControl
     JSValueRef appControl = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_APP_CONTROL);
-    priv->setApplicationControl(DeviceAPI::Application::JSApplicationControl::getApplicationControl(context, JSUtil::JSValueToObject(context,appControl)));
+    if (!JSValueIsUndefined(context, appControl) && !JSValueIsNull(context, appControl))
+       priv->setApplicationControl(DeviceAPI::Application::JSApplicationControl::getApplicationControl(context, JSUtil::JSValueToObject(context,appControl)));
 
     // appId
     JSValueRef appId = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_APP_ID);