API: fix bugs of query construction & GVariant extraction 02/118902/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 14 Mar 2017 11:43:09 +0000 (20:43 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 14 Mar 2017 11:43:09 +0000 (20:43 +0900)
Change-Id: Id47ea1dcddff38717f1aecc8acd8a2cb15bef7a7
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/client/ContextStoreSearchQuery.cpp
src/client/PlatformManagedStore.cpp

index d401725..e1161b6 100644 (file)
@@ -27,7 +27,10 @@ ContextStoreSearchQuery::ContextStoreSearchQuery() :
 ContextStoreSearchQuery::ContextStoreSearchQuery(const std::string& projection,
                const std::string& selection, const std::string& sortOrder,
                unsigned int limit) :
-       __limit(0)
+       __projection(projection),
+       __selection(selection),
+       __sortOrder(sortOrder),
+       __limit(limit)
 {
 }
 
index 1c0c8f8..ed913af 100644 (file)
@@ -71,7 +71,10 @@ int PlatformManagedStore::retrieve(const ContextStoreSearchQuery& query, std::ve
        int error = __proxy->call(METHOD_RETRIEVE, param, &outParam);
        IF_FAIL_RETURN_TAG(error == E_NONE, error, _E, "%s", CTX_ERROR_STR(error));
 
-       result = Tuple::buildFrom(g_variant_get_child_value(outParam, IDX_RETRIEVE_RESULT));
+       GVariant* vals = NULL;
+       g_variant_get(outParam, "(v)", &vals);
+
+       result = Tuple::buildFrom(vals);
        return E_NONE;
 }