Merge lp:~aacid/u1db-qt/qt54 into lp:u1db-qt

Proposed by Albert Astals Cid on 2015-02-19
Status: Merged
Approved by: Christian Dywan on 2015-02-19
Approved revision: 122
Merged at revision: 122
Proposed branch: lp:~aacid/u1db-qt/qt54
Merge into: lp:u1db-qt
Diff against target: 36 lines (+9/-0)
2 files modified
src/database.cpp (+3/-0)
src/document.cpp (+6/-0)
To merge this branch: bzr merge lp:~aacid/u1db-qt/qt54
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-02-19
Christian Dywan 2015-02-19 Approve on 2015-02-19
Review via email: mp+250282@code.launchpad.net

Commit message

Make tests pass with Qt 5.4

To post a comment you must log in.
Christian Dywan (kalikiana) wrote :

For the record, the lack of an "else" slightly bugged me, but the fact is that an empty string can be passed to putDoc and thereby contents to delete an existing document, thus I feel it's not something to tackle here as part of the fix.

Thanks a lot!

review: Approve
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/database.cpp'
2--- src/database.cpp 2014-11-07 14:30:31 +0000
3+++ src/database.cpp 2015-02-19 10:38:43 +0000
4@@ -626,6 +626,9 @@
5 if (!initializeIfNeeded())
6 return "";
7
8+ if (contents.canConvert<QVariantMap>())
9+ contents = contents.value<QVariantMap>();
10+
11 ScopedTransaction t(m_db);
12
13 QString newOrEmptyDocId(docId);
14
15=== modified file 'src/document.cpp'
16--- src/document.cpp 2013-04-23 15:17:24 +0000
17+++ src/document.cpp 2015-02-19 10:38:43 +0000
18@@ -172,6 +172,9 @@
19 void
20 Document::setDefaults(QVariant defaults)
21 {
22+ if (defaults.canConvert<QVariantMap>())
23+ defaults = defaults.value<QVariantMap>();
24+
25 if (m_defaults == defaults)
26 return;
27
28@@ -195,6 +198,9 @@
29 void
30 Document::setContents(QVariant contents)
31 {
32+ if (contents.canConvert<QVariantMap>())
33+ contents = contents.value<QVariantMap>();
34+
35 if (m_contents == contents)
36 return;
37

Subscribers

People subscribed via source and target branches

to all changes: