diff options
author | Tapani Mikola <tapani.mikola@nokia.com> | 2012-06-11 14:45:18 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-12 16:29:37 +0200 |
commit | 1a8daed25f10ac53e468b83816f4024f22f83d75 (patch) | |
tree | eeb2ec86e4268380a111a3b5049bfe8f8122f7d6 | |
parent | c9a3abd1939b5921ba317361e498b36b0e942e9e (diff) |
Fix warnings in declarative examples
Change-Id: I588987412859713de3fe5fdf1f5d67fa8a97bf02
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
-rw-r--r-- | examples/declarative/joinview/joinview.qml | 29 | ||||
-rw-r--r-- | examples/declarative/map-phone/map-phone.qml | 9 | ||||
-rw-r--r-- | examples/declarative/reduce-phone/reduce-phone.qml | 9 | ||||
-rw-r--r-- | examples/declarative/simplelistmodel/simplelistmodel.qml | 11 |
4 files changed, 34 insertions, 24 deletions
diff --git a/examples/declarative/joinview/joinview.qml b/examples/declarative/joinview/joinview.qml index 9d445eb..7fdbb9e 100644 --- a/examples/declarative/joinview/joinview.qml +++ b/examples/declarative/joinview/joinview.qml @@ -68,15 +68,22 @@ Rectangle { //! [Installing the View Schema] var schema = {"_type": "_schemaType", "name": "ContactLogView", "schema": {"extends": "View"}}; systemPartition.create(schema, installMap); -//! [Installing the View Schema] - var indexDefinition = { - "_type": "Index", - "name": "number", - "propertyName": "number", - "propertyType": "string" - }; + //! [Installing the View Schema] + var indexDefinitions = [{ + "_type": "Index", + "name": "number", + "propertyName": "number", + "propertyType": "string" + }, + { + "_type": "Index", + "name": "logDate", + "objectType": "ContactLogView", + "propertyName": "date", + "propertyType": "string" + }]; //! [Installing the Join Object] - systemPartition.create(indexDefinition); + systemPartition.create(indexDefinitions); //! [Installing the Join Object] } } @@ -95,7 +102,7 @@ Rectangle { if (results.length > 0) { // Map object exists, set partition console.log("Map Created"); - contacts.partition = systemPartition; + contacts.partitions = [systemPartition]; } else { systemPartition.create(createJoinDefinition(), installMap); } @@ -156,8 +163,8 @@ Rectangle { JsonDb.JsonDbListModel { id: contacts - partition: systemPartition - query: '[?_type="ContactLogView"][/date]' + query: '[?_type="ContactLogView"]' + sortOrder: "[/logDate]" roleNames: ["date", "name", "number"] } diff --git a/examples/declarative/map-phone/map-phone.qml b/examples/declarative/map-phone/map-phone.qml index 70eb052..3496b17 100644 --- a/examples/declarative/map-phone/map-phone.qml +++ b/examples/declarative/map-phone/map-phone.qml @@ -87,7 +87,7 @@ Rectangle { var results = mapTypeQuery.takeResults(); if (results.length > 0) { // Map object exists, set partition - contacts.partition = systemPartition; + contacts.partitions = [systemPartition]; } else { //! [Creating a Map Object] var mapDefinition = { "_type": "Map", "targetType": "PhoneView", @@ -125,9 +125,10 @@ Rectangle { JsonDb.JsonDbListModel { id: contacts - query: '[?_type="PhoneView"][/phoneNumber]' + query: '[?_type="PhoneView"]' + sortOrder: '[/phoneNumber]' roleNames: ["phoneNumber", "firstName", "lastName"] - limit: 100 + cacheSize: 100 } Component.onCompleted: { schemaTypeQuery.start(); } Rectangle { @@ -200,7 +201,7 @@ Rectangle { Text { anchors.centerIn: parent font.pointSize: fontsize-4 - text: "Cache Limit : " + contacts.limit + " rowCount : " + contacts.rowCount + " state : " + contacts.state + text: "Cache size : " + contacts.cacheSize + " rowCount : " + contacts.rowCount + " state : " + contacts.state } } Rectangle { diff --git a/examples/declarative/reduce-phone/reduce-phone.qml b/examples/declarative/reduce-phone/reduce-phone.qml index b7dc25e..1e5df59 100644 --- a/examples/declarative/reduce-phone/reduce-phone.qml +++ b/examples/declarative/reduce-phone/reduce-phone.qml @@ -86,7 +86,7 @@ Rectangle { var results = reduceTypeQuery.takeResults(); if (results.length > 0) { // Reduce object exists, set partition - contacts.partition = systemPartition; + contacts.partitions = [systemPartition]; } else { // Create Map Object var reduceDefinition = { @@ -140,9 +140,10 @@ Rectangle { JsonDb.JsonDbListModel { id: contacts - query: '[?_type="ReducedPhoneView"][/key]' + query: '[?_type="ReducedPhoneView"]' + sortOrder: '[/key]' roleNames: ["key", "value"] - limit: 100 + cacheSize: 100 } Component.onCompleted: { schemaTypeQuery.start(); } @@ -179,7 +180,7 @@ Rectangle { Text { anchors.centerIn: parent font.pointSize: fontsize-4 - text: "Cache limit : " + contacts.limit + " rowCount : " + contacts.rowCount + " state : " + contacts.state + text: "Cache size : " + contacts.cacheSize + " rowCount : " + contacts.rowCount + " state : " + contacts.state } } Rectangle { diff --git a/examples/declarative/simplelistmodel/simplelistmodel.qml b/examples/declarative/simplelistmodel/simplelistmodel.qml index f3eebdc..0e84d7e 100644 --- a/examples/declarative/simplelistmodel/simplelistmodel.qml +++ b/examples/declarative/simplelistmodel/simplelistmodel.qml @@ -54,8 +54,9 @@ Item { JsonDb.JsonDbListModel { id: contacts query: '[?_type="Contact"]' + sortOrder: '[/lastName]' roleNames: ["firstName", "lastName", "_uuid"] - limit: 40 + cacheSize: 40 } function checkForPartitions(error, result) { @@ -90,7 +91,7 @@ Item { }; nokiaPartition.create(indexDefinition2); - contacts.partition = nokiaPartition; + contacts.partitions = [nokiaPartition]; } } } @@ -138,7 +139,7 @@ Item { text: "Sort firstName" onClicked: { - contacts.query = ("[?_type=\"Contact\"][/firstName]") + contacts.sortOrder = '[/firstName]' } } @@ -150,7 +151,7 @@ Item { text: "Sort lastName" onClicked: { - contacts.query = ("[?_type=\"Contact\"][/lastName]") + contacts.sortOrder = '[/lastName]' } } @@ -187,7 +188,7 @@ Item { color: "lightgray" Text { anchors.centerIn: parent - text: "limit : " + contacts.limit + " rowCount : " + contacts.rowCount + " state : " + contacts.state + text: "cache size : " + contacts.cacheSize + " rowCount : " + contacts.rowCount + " state : " + contacts.state } } } |