diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-04-11 14:14:33 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-04-11 14:14:33 +0200 |
commit | d3f14ec2b3d7fbb1dd840775df6b2dec71827a81 (patch) | |
tree | 66711358745fcff3c76d5b34ed59d5be3d43e2e9 | |
parent | b99bd60d27df2d487e89d5f07023c32e86ef6d3b (diff) | |
parent | da39c3b555688fc868fc886452c1e78c8c41a430 (diff) | |
download | qtenginio-d3f14ec2b3d7fbb1dd840775df6b2dec71827a81.tar.gz |
Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I55dd178b83ec44d76002eac40a8bbbd4d2826c79
-rw-r--r-- | doc/shared/model-query.qdocinc | 23 | ||||
-rw-r--r-- | doc/shared/model-remove.qdocinc | 3 | ||||
-rw-r--r-- | examples/enginio/quick/users/doc/src/users.qdoc | 2 | ||||
-rw-r--r-- | src/enginio_client/enginiomodel.cpp | 14 | ||||
-rw-r--r-- | src/enginio_plugin/enginioqmlmodel.cpp | 8 | ||||
-rw-r--r-- | tests/auto/enginiomodel/tst_enginiomodel.cpp | 2 |
6 files changed, 33 insertions, 19 deletions
diff --git a/doc/shared/model-query.qdocinc b/doc/shared/model-query.qdocinc index bdba13a..f9fe954 100644 --- a/doc/shared/model-query.qdocinc +++ b/doc/shared/model-query.qdocinc @@ -1,19 +1,24 @@ +/*! +//![0] \brief The query used to populate the model with data from the backend. -It takes the same argument as \l EnginioClient::query(), so that the documentation -for \l EnginioClient::query() can be consulted regarding how to construct the query. +See +//![0] +\l {EnginioClient::query()} +//![1] +documentation for information on how to construct a query. -While \l EnginioClient::query() returns the data of a query as a JSON -object, for the model the query will be interpreted as the model data. +While the EnginioClient implementation of \c query() returns +the data of a query as a JSON object, for the model the query will be +interpreted as the model data. -Usually the query is for one object type and will return all objects +Usually, the query is for a single object type and will return all objects in the database of that type. The model will then represent each returned object as one row. It can be limited and sorted just like its counterpart in EnginioClient. One important thing to note is that the model cannot keep the same sorting as -the backend and thus sorting and limits are only preserved until +the backend, and thus sorting and limits are only preserved until an insertion or deletion happens. - -\return the EnginioReply from the backend -\sa EnginioClient::query() +//![1] +*/ diff --git a/doc/shared/model-remove.qdocinc b/doc/shared/model-remove.qdocinc index 94de12d..242ca9d 100644 --- a/doc/shared/model-remove.qdocinc +++ b/doc/shared/model-remove.qdocinc @@ -4,5 +4,4 @@ This function immediately removes the \a row from the local cache and sends a remove request to the Enginio backend. -\return the EnginioReply from the backend -\sa EnginioClient::remove()
\ No newline at end of file +\return the EnginioReply from the backend. diff --git a/examples/enginio/quick/users/doc/src/users.qdoc b/examples/enginio/quick/users/doc/src/users.qdoc index e93af16..1420e60 100644 --- a/examples/enginio/quick/users/doc/src/users.qdoc +++ b/examples/enginio/quick/users/doc/src/users.qdoc @@ -93,7 +93,7 @@ Then, depending on the state of the application, we assign the object to our enginioClient instance. There are four possible states, defined by - \l{EnginioClient::AuthenticationState}. After assigning the Identity object, + \l{Enginio::AuthenticationState}. After assigning the Identity object, the state changes from the initial "NotAuthenticated" to "Authenticating". \snippet users/Login.qml assignIdentity diff --git a/src/enginio_client/enginiomodel.cpp b/src/enginio_client/enginiomodel.cpp index 72648d5..3d5f93d 100644 --- a/src/enginio_client/enginiomodel.cpp +++ b/src/enginio_client/enginiomodel.cpp @@ -77,7 +77,7 @@ const int EnginioBaseModelPrivate::IncrementalModelUpdate = -2; Assigning such a query to the model results in downloading of all objects from the "objects.fruits" collection. It is possible to \l{EnginioModel::append()}{append} new objects, to - \l{EnginioModel::setProperty()}{modify} or to \l{EnginioModel::remove()}{remove} them. + \l{EnginioModel::setData()}{modify} or to \l{EnginioModel::remove()}{remove} them. The query has to result in a list of objects, each object becomes an item in the model. Properties of the items are used as role names. @@ -439,7 +439,11 @@ void EnginioModel::setClient(const EnginioClient *client) /*! \property EnginioModel::query - \include model-query.qdocinc + \include model-query.qdocinc 0 + \l {EnginioClient::query()} + \include model-query.qdocinc 1 + + \sa EnginioClient::query() */ QJsonObject EnginioModel::query() { @@ -459,7 +463,6 @@ void EnginioModel::setQuery(const QJsonObject &query) \property EnginioModel::operation \brief The operation type of the query \sa Enginio::Operation, query() - \return returns the Operation */ Enginio::Operation EnginioModel::operation() const { @@ -493,6 +496,7 @@ EnginioReply *EnginioModel::append(const QJsonObject &object) /*! \include model-remove.qdocinc + \sa EnginioClient::remove() */ EnginioReply *EnginioModel::remove(int row) { @@ -518,14 +522,14 @@ EnginioReply *EnginioModel::remove(int row) The \a role is the property of the object that will be updated to be the new \a value. - \return reply from backend + \return reply from backend. \sa EnginioClient::update() */ EnginioReply *EnginioModel::setData(int row, const QVariant &value, const QString &role) { Q_D(EnginioModel); if (Q_UNLIKELY(!d->enginio())) { - qWarning("EnginioModel::setProperty(): Enginio client is not set"); + qWarning("EnginioModel::setData(): Enginio client is not set"); return 0; } diff --git a/src/enginio_plugin/enginioqmlmodel.cpp b/src/enginio_plugin/enginioqmlmodel.cpp index b09b339..43d0198 100644 --- a/src/enginio_plugin/enginioqmlmodel.cpp +++ b/src/enginio_plugin/enginioqmlmodel.cpp @@ -80,7 +80,11 @@ QT_BEGIN_NAMESPACE /*! \qmlproperty QJSValue EnginioModel::query - \include model-query.qdocinc + \include model-query.qdocinc 0 + \l {Enginio::EnginioClient::query()}{EnginioClient::query()} + \include model-query.qdocinc 1 + + \sa {Enginio::EnginioClient::query()}{EnginioClient::query()} */ /*! @@ -113,6 +117,8 @@ QT_BEGIN_NAMESPACE /*! \qmlmethod EnginioReply EnginioModel::remove(int row) \include model-remove.qdocinc + + \sa {Enginio::EnginioClient::remove()}{EnginioClient::remove()} */ namespace { diff --git a/tests/auto/enginiomodel/tst_enginiomodel.cpp b/tests/auto/enginiomodel/tst_enginiomodel.cpp index 113aa9c..5edc707 100644 --- a/tests/auto/enginiomodel/tst_enginiomodel.cpp +++ b/tests/auto/enginiomodel/tst_enginiomodel.cpp @@ -194,7 +194,7 @@ void tst_EnginioModel::enginio_property() QVERIFY(!model.append(QJsonObject())); QTest::ignoreMessage(QtWarningMsg, "EnginioModel::remove(): Enginio client is not set"); QVERIFY(!model.remove(0)); - QTest::ignoreMessage(QtWarningMsg, "EnginioModel::setProperty(): Enginio client is not set"); + QTest::ignoreMessage(QtWarningMsg, "EnginioModel::setData(): Enginio client is not set"); QVERIFY(!model.setData(0, QVariant(), "blah")); } { |