Merge lp://qastaging/~kalikiana/u1db-qt/removeDoc into lp://qastaging/u1db-qt
Proposed by
Cris Dywan
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 110 | ||||
Merged at revision: | 110 | ||||
Proposed branch: | lp://qastaging/~kalikiana/u1db-qt/removeDoc | ||||
Merge into: | lp://qastaging/u1db-qt | ||||
Diff against target: |
43 lines (+11/-1) 3 files modified
src/database.cpp (+9/-0) src/database.h (+1/-0) tests/tst_query.qml (+1/-1) |
||||
To merge this branch: | bzr merge lp://qastaging/~kalikiana/u1db-qt/removeDoc | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Benjamin Zeller | Approve | ||
Review via email: mp+196301@code.qastaging.launchpad.net |
Commit message
Implement Database.removeDoc method and use it in unit test
Functionally this is equivalent to replacing the doc with an empty one.
To post a comment you must log in.
Isn't it that documents should always be null or empty and not removed?
If a document is null or empty it should be filtered out in Query or Index
should it not? Those are the mechanisms for filtering results, it seems
maybe the functionality should be there rather than Database, no?
On Nov 22, 2013 4:25 PM, "Christian Dywan" <email address hidden> wrote:
> Christian Dywan has proposed merging lp:~kalikiana/u1db-qt/removeDoc into /bugs.launchpad .net/u1db- qt/+bug/ 1243395 /code.launchpad .net/~kalikiana /u1db-qt/ removeDoc/ +merge/ 196301 /code.launchpad .net/~kalikiana /u1db-qt/ removeDoc/ +merge/ 196301 :removeDoc( const QString& docId) :resetModel ents(const QString& docId); (const QString& docId) const; tst_query. qml' defaultPhone. documents, ['1', '_', 'a'], 'uno') ('_') defaultPhone. documents, ['1', 'a'], 'dos') /launchpad. net/~uonedb- qt /launchpad. net/~uonedb- qt /help.launchpad .net/ListHelp
> lp:u1db-qt.
>
> Commit message:
> Implement Database.removeDoc method and use it in unit test
>
> Requested reviews:
> U1DB Qt developers (uonedb-qt)
> Related bugs:
> Bug #1243395 in U1DB Qt/ QML: "Need API to delete documents from QML"
> https:/
>
> For more details, see:
> https:/
> --
> https:/
> Your team U1DB Qt developers is requested to review the proposed merge of
> lp:~kalikiana/u1db-qt/removeDoc into lp:u1db-qt.
>
> === modified file 'src/database.cpp'
> --- src/database.cpp 2013-08-14 12:07:11 +0000
> +++ src/database.cpp 2013-11-22 15:24:45 +0000
> @@ -658,6 +658,15 @@
> }
>
> /*!
> + Removes the document identified by \a docId.
> + */
> +void
> +Database:
> +{
> + putDoc(QString(), docId);
> +}
> +
> +/*!
> * \brief Database:
> *
> * Resets the Database model.
>
> === modified file 'src/database.h'
> --- src/database.h 2013-08-12 15:28:13 +0000
> +++ src/database.h 2013-11-22 15:24:45 +0000
> @@ -49,6 +49,7 @@
> QString getDocumentCont
> QVariant getDocUnchecked
> Q_INVOKABLE QString putDoc(QVariant newDoc, const QString&
> docID=QString());
> + Q_INVOKABLE void removeDoc(const QString& docID);
> Q_INVOKABLE QList<QString> listDocs();
> Q_INVOKABLE QString lastError();
> Q_INVOKABLE QString putIndex(const QString& index_name, QStringList
> expressions);
>
> === modified file 'tests/
> --- tests/tst_query.qml 2013-08-27 10:49:26 +0000
> +++ tests/tst_query.qml 2013-11-22 15:24:45 +0000
> @@ -182,7 +182,7 @@
> function test_4_delete () {
> compare(
> // Deleted aka empty documents should not be returned
> - gents.putDoc('', '_')
> + gents.removeDoc
> compare(
> }
>
>
>
> --
> Mailing list: https:/
> Post to : <email address hidden>
> Unsubscribe : https:/
> More help : https:/
>
>