Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 118 | ||||
Merged at revision: | 124 | ||||
Proposed branch: | lp:~kalikiana/u1db-qt/qmlDocs | ||||
Merge into: | lp:u1db-qt | ||||
Diff against target: |
1204 lines (+367/-149) 11 files modified
documentation/u1db.qdocconf (+1/-6) src/database.cpp (+66/-15) src/database.h (+10/-0) src/document.cpp (+68/-21) src/document.h (+20/-1) src/index.cpp (+49/-18) src/index.h (+12/-1) src/query.cpp (+54/-14) src/query.h (+16/-0) src/synchronizer.cpp (+66/-70) src/synchronizer.h (+5/-3) |
||||
To merge this branch: | bzr merge lp:~kalikiana/u1db-qt/qmlDocs | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+208818@code.launchpad.net |
Commit message
Port qdoc syntax to QML annotations
Description of the change
This gets us QML docs, including a few tweaks to ensure each has one example at the top, using highlighting and identifier linking. Behind each component a link is available to reveal the C++ version.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:117
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Marco Trevisan (Treviño) (3v1n0) wrote : | # |
Looks good... Added two small comments, just to stay in sync with the recent approved changes...
- 118. By Cris Dywan
-
Clarify path behavior documentation
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:118
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'documentation/u1db.qdocconf' | |||
2 | --- documentation/u1db.qdocconf 2013-09-06 10:00:36 +0000 | |||
3 | +++ documentation/u1db.qdocconf 2015-03-24 19:42:30 +0000 | |||
4 | @@ -5,12 +5,7 @@ | |||
5 | 5 | 5 | ||
6 | 6 | sourcedirs = ../src \ | 6 | sourcedirs = ../src \ |
7 | 7 | ../documentation | 7 | ../documentation |
14 | 8 | headers = ../src/database.h \ | 8 | headerdirs = ../src/ |
9 | 9 | ../src/document.h \ | ||
10 | 10 | ../src/index.h \ | ||
11 | 11 | ../src/query.h \ | ||
12 | 12 | ../src/synchronizer.h \ | ||
13 | 13 | ../src/global.h | ||
15 | 14 | Cpp.ignoretokens = Q_DECL_EXPORT \ | 9 | Cpp.ignoretokens = Q_DECL_EXPORT \ |
16 | 15 | Q_PROPERTY \ | 10 | Q_PROPERTY \ |
17 | 16 | QT_BEGIN_NAMESPACE_U1DB \ | 11 | QT_BEGIN_NAMESPACE_U1DB \ |
18 | 17 | 12 | ||
19 | === modified file 'src/database.cpp' | |||
20 | --- src/database.cpp 2015-02-19 10:37:54 +0000 | |||
21 | +++ src/database.cpp 2015-03-24 19:42:30 +0000 | |||
22 | @@ -17,7 +17,6 @@ | |||
23 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | 18 | */ | 18 | */ |
25 | 19 | 19 | ||
26 | 20 | #include <QDebug> | ||
27 | 21 | #include <QSqlQuery> | 20 | #include <QSqlQuery> |
28 | 22 | #include <QFile> | 21 | #include <QFile> |
29 | 23 | #include <QFileInfo> | 22 | #include <QFileInfo> |
30 | @@ -63,16 +62,41 @@ | |||
31 | 63 | /*! | 62 | /*! |
32 | 64 | \class Database | 63 | \class Database |
33 | 65 | \inmodule U1Db | 64 | \inmodule U1Db |
35 | 66 | \ingroup modules | 65 | \ingroup cpp |
36 | 67 | 66 | ||
39 | 68 | \brief The Database class implements the on-disk storage of an individual | 67 | \brief The Database class implements on-disk storage for documents and indexes. |
38 | 69 | U1DB database. | ||
40 | 70 | 68 | ||
41 | 71 | Database can be used as a QAbstractListModel, delegates will then have access to \a docId and \a contents | 69 | Database can be used as a QAbstractListModel, delegates will then have access to \a docId and \a contents |
42 | 72 | analogous to the properties of Document. | 70 | analogous to the properties of Document. |
43 | 73 | */ | 71 | */ |
44 | 74 | 72 | ||
45 | 75 | /*! | 73 | /*! |
46 | 74 | \qmltype Database | ||
47 | 75 | \instantiates Database | ||
48 | 76 | \inqmlmodule U1Db 1.0 | ||
49 | 77 | \ingroup modules | ||
50 | 78 | |||
51 | 79 | \brief Database implements on-disk storage for documents and indexes. | ||
52 | 80 | |||
53 | 81 | In a ListView the Database can be used as a model which includes all documents | ||
54 | 82 | in the database. For listing only a subset of documents Query can be used. | ||
55 | 83 | |||
56 | 84 | \qml | ||
57 | 85 | ListView { | ||
58 | 86 | model: Database { | ||
59 | 87 | id: myDatabase | ||
60 | 88 | } | ||
61 | 89 | delegate: ListItem.Subtitled { | ||
62 | 90 | text: docId | ||
63 | 91 | subText: contents.color | ||
64 | 92 | } | ||
65 | 93 | } | ||
66 | 94 | \endqml | ||
67 | 95 | |||
68 | 96 | \sa Query | ||
69 | 97 | */ | ||
70 | 98 | |||
71 | 99 | /*! | ||
72 | 76 | A unique identifier for the state of synchronization | 100 | A unique identifier for the state of synchronization |
73 | 77 | */ | 101 | */ |
74 | 78 | QString | 102 | QString |
75 | @@ -110,7 +134,10 @@ | |||
76 | 110 | } | 134 | } |
77 | 111 | 135 | ||
78 | 112 | /*! | 136 | /*! |
80 | 113 | \property Database::error | 137 | \qmlproperty string Database::error |
81 | 138 | The last error as a string if the last operation failed. | ||
82 | 139 | */ | ||
83 | 140 | /*! | ||
84 | 114 | The last error as a string if the last operation failed. | 141 | The last error as a string if the last operation failed. |
85 | 115 | */ | 142 | */ |
86 | 116 | QString | 143 | QString |
87 | @@ -335,10 +362,16 @@ | |||
88 | 335 | 362 | ||
89 | 336 | 363 | ||
90 | 337 | /*! | 364 | /*! |
91 | 365 | \qmlmethod Variant Database::getDoc(string) | ||
92 | 338 | Returns the contents of a document by \a docId in a form that QML recognizes | 366 | Returns the contents of a document by \a docId in a form that QML recognizes |
93 | 339 | as a Variant object, it's identical to Document::getContents() with the | 367 | as a Variant object, it's identical to Document::getContents() with the |
94 | 340 | same \a docId. | 368 | same \a docId. |
95 | 341 | */ | 369 | */ |
96 | 370 | /*! | ||
97 | 371 | * Returns the contents of a document by \a docId in a form that QML recognizes | ||
98 | 372 | * as a Variant object, it's identical to Document::getContents() with the | ||
99 | 373 | * same \a docId. | ||
100 | 374 | */ | ||
101 | 342 | QVariant | 375 | QVariant |
102 | 343 | Database::getDoc(const QString& docId) | 376 | Database::getDoc(const QString& docId) |
103 | 344 | { | 377 | { |
104 | @@ -513,7 +546,6 @@ | |||
105 | 513 | 546 | ||
106 | 514 | /*! | 547 | /*! |
107 | 515 | * \internal | 548 | * \internal |
108 | 516 | * \brief Database::updateDocRevisionNumber | ||
109 | 517 | * | 549 | * |
110 | 518 | * Whenever a document as added or modified it needs a new revision number. | 550 | * Whenever a document as added or modified it needs a new revision number. |
111 | 519 | * | 551 | * |
112 | @@ -614,6 +646,14 @@ | |||
113 | 614 | } | 646 | } |
114 | 615 | 647 | ||
115 | 616 | /*! | 648 | /*! |
116 | 649 | \qmlmethod string Database::putDoc(var, string) | ||
117 | 650 | Updates the existing \a contents of the document identified by \a docId if | ||
118 | 651 | there's no error. | ||
119 | 652 | If no \a docId is given or \a docId is an empty string the \a contents will be | ||
120 | 653 | stored under an autogenerated name. | ||
121 | 654 | Returns the new revision of the document, or -1 on failure. | ||
122 | 655 | */ | ||
123 | 656 | /*! | ||
124 | 617 | Updates the existing \a contents of the document identified by \a docId if | 657 | Updates the existing \a contents of the document identified by \a docId if |
125 | 618 | there's no error. | 658 | there's no error. |
126 | 619 | If no \a docId is given or \a docId is an empty string the \a contents will be | 659 | If no \a docId is given or \a docId is an empty string the \a contents will be |
127 | @@ -687,6 +727,10 @@ | |||
128 | 687 | } | 727 | } |
129 | 688 | 728 | ||
130 | 689 | /*! | 729 | /*! |
131 | 730 | \qmlmethod void Database::deleteDoc(string) | ||
132 | 731 | Deletes the document identified by \a docId. | ||
133 | 732 | */ | ||
134 | 733 | /*! | ||
135 | 690 | Deletes the document identified by \a docId. | 734 | Deletes the document identified by \a docId. |
136 | 691 | */ | 735 | */ |
137 | 692 | void | 736 | void |
138 | @@ -710,6 +754,10 @@ | |||
139 | 710 | 754 | ||
140 | 711 | 755 | ||
141 | 712 | /*! | 756 | /*! |
142 | 757 | \qmlmethod list<string> Database::listDocs() | ||
143 | 758 | Returns a list of all stored documents by their docId. | ||
144 | 759 | */ | ||
145 | 760 | /*! | ||
146 | 713 | Returns a list of all stored documents by their docId. | 761 | Returns a list of all stored documents by their docId. |
147 | 714 | */ | 762 | */ |
148 | 715 | QList<QString> | 763 | QList<QString> |
149 | @@ -737,11 +785,17 @@ | |||
150 | 737 | } | 785 | } |
151 | 738 | 786 | ||
152 | 739 | /*! | 787 | /*! |
158 | 740 | \property Database::path | 788 | \qmlproperty string Database::path |
159 | 741 | A relative filename can be given to store the database in an app-specific | 789 | A relative \a path can be given to store the database in an app-specific |
160 | 742 | writable folder. This is recommended as it ensures to work with confinement. | 790 | writable folder. This is recommended as it ensures to work with confinement. |
161 | 743 | If more control is needed absolute paths can be used. | 791 | If more control is needed absolute paths or local file URIs can be used. |
162 | 744 | By default everything is stored in memory. | 792 | By default or if the path is empty everything is stored in memory. |
163 | 793 | */ | ||
164 | 794 | /*! | ||
165 | 795 | A relative \a path can be given to store the database in an app-specific | ||
166 | 796 | writable folder. This is recommended as it ensures to work with confinement. | ||
167 | 797 | If more control is needed absolute paths or local file URIs can be used. | ||
168 | 798 | By default or if the path is empty everything is stored in memory. | ||
169 | 745 | */ | 799 | */ |
170 | 746 | void | 800 | void |
171 | 747 | Database::setPath(const QString& path) | 801 | Database::setPath(const QString& path) |
172 | @@ -759,10 +813,7 @@ | |||
173 | 759 | } | 813 | } |
174 | 760 | 814 | ||
175 | 761 | /*! | 815 | /*! |
180 | 762 | * \brief Database::getPath | 816 | * Returns the path of the database. |
177 | 763 | * | ||
178 | 764 | * Simply returns the path of the database. | ||
179 | 765 | * | ||
181 | 766 | */ | 817 | */ |
182 | 767 | QString | 818 | QString |
183 | 768 | Database::getPath() | 819 | Database::getPath() |
184 | 769 | 820 | ||
185 | === modified file 'src/database.h' | |||
186 | --- src/database.h 2014-01-24 11:13:35 +0000 | |||
187 | +++ src/database.h 2015-03-24 19:42:30 +0000 | |||
188 | @@ -31,7 +31,9 @@ | |||
189 | 31 | 31 | ||
190 | 32 | class Q_DECL_EXPORT Database : public QAbstractListModel { | 32 | class Q_DECL_EXPORT Database : public QAbstractListModel { |
191 | 33 | Q_OBJECT | 33 | Q_OBJECT |
192 | 34 | /*! path */ | ||
193 | 34 | Q_PROPERTY(QString path READ getPath WRITE setPath NOTIFY pathChanged) | 35 | Q_PROPERTY(QString path READ getPath WRITE setPath NOTIFY pathChanged) |
194 | 36 | /*! error */ | ||
195 | 35 | Q_PROPERTY(QString error READ lastError NOTIFY errorChanged) | 37 | Q_PROPERTY(QString error READ lastError NOTIFY errorChanged) |
196 | 36 | public: | 38 | public: |
197 | 37 | Database(QObject* parent = 0); | 39 | Database(QObject* parent = 0); |
198 | @@ -65,7 +67,15 @@ | |||
199 | 65 | QMap<QString,QVariant> getSyncLogInfo(QMap<QString,QVariant> lastSyncInformation, QString uid, QString prefix); | 67 | QMap<QString,QVariant> getSyncLogInfo(QMap<QString,QVariant> lastSyncInformation, QString uid, QString prefix); |
200 | 66 | 68 | ||
201 | 67 | Q_SIGNALS: | 69 | Q_SIGNALS: |
202 | 70 | /*! | ||
203 | 71 | \signal Database::pathChanged | ||
204 | 72 | The database path changed - the empty string means it's in-memory only. | ||
205 | 73 | */ | ||
206 | 68 | void pathChanged(const QString& path); | 74 | void pathChanged(const QString& path); |
207 | 75 | /*! | ||
208 | 76 | \signal Database::errorChanged | ||
209 | 77 | An error occurred. Use lastError() to check it. | ||
210 | 78 | */ | ||
211 | 69 | void errorChanged(const QString& error); | 79 | void errorChanged(const QString& error); |
212 | 70 | /*! | 80 | /*! |
213 | 71 | A document's contents were modified. | 81 | A document's contents were modified. |
214 | 72 | 82 | ||
215 | === modified file 'src/document.cpp' | |||
216 | --- src/document.cpp 2015-02-19 10:37:54 +0000 | |||
217 | +++ src/document.cpp 2015-03-24 19:42:30 +0000 | |||
218 | @@ -17,14 +17,6 @@ | |||
219 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
220 | 18 | */ | 18 | */ |
221 | 19 | 19 | ||
222 | 20 | #include <QDebug> | ||
223 | 21 | #include <QSqlQuery> | ||
224 | 22 | #include <QFile> | ||
225 | 23 | #include <QSqlError> | ||
226 | 24 | #include <QUuid> | ||
227 | 25 | #include <QStringList> | ||
228 | 26 | #include <QJsonDocument> | ||
229 | 27 | |||
230 | 28 | #include "document.h" | 20 | #include "document.h" |
231 | 29 | #include "private.h" | 21 | #include "private.h" |
232 | 30 | 22 | ||
233 | @@ -33,12 +25,34 @@ | |||
234 | 33 | /*! | 25 | /*! |
235 | 34 | \class Document | 26 | \class Document |
236 | 35 | \inmodule U1db | 27 | \inmodule U1db |
237 | 28 | \ingroup cpp | ||
238 | 29 | |||
239 | 30 | \brief The Document class proxies a single document stored in the Database. | ||
240 | 31 | */ | ||
241 | 32 | |||
242 | 33 | |||
243 | 34 | /*! | ||
244 | 35 | \qmltype Document | ||
245 | 36 | \instantiates Document | ||
246 | 37 | \inqmlmodule U1db 1.0 | ||
247 | 36 | \ingroup modules | 38 | \ingroup modules |
248 | 37 | 39 | ||
250 | 38 | \brief The Document class proxies a single document stored in the Database. | 40 | \brief Document proxies a single document stored in the Database. |
251 | 39 | 41 | ||
252 | 40 | This is the declarative API equivalent of Database::putDoc() and | 42 | This is the declarative API equivalent of Database::putDoc() and |
253 | 41 | Database::getDoc(). | 43 | Database::getDoc(). |
254 | 44 | |||
255 | 45 | \qml | ||
256 | 46 | Document { | ||
257 | 47 | docId: 'myId' | ||
258 | 48 | defaults: { | ||
259 | 49 | color: 'blue' | ||
260 | 50 | } | ||
261 | 51 | create: true | ||
262 | 52 | } | ||
263 | 53 | \endqml | ||
264 | 54 | |||
265 | 55 | \sa Database | ||
266 | 42 | */ | 56 | */ |
267 | 43 | 57 | ||
268 | 44 | /*! | 58 | /*! |
269 | @@ -50,6 +64,9 @@ | |||
270 | 50 | { | 64 | { |
271 | 51 | } | 65 | } |
272 | 52 | 66 | ||
273 | 67 | /*! | ||
274 | 68 | Returns the \l Database. | ||
275 | 69 | */ | ||
276 | 53 | Database* | 70 | Database* |
277 | 54 | Document::getDatabase() | 71 | Document::getDatabase() |
278 | 55 | { | 72 | { |
279 | @@ -77,8 +94,7 @@ | |||
280 | 77 | } | 94 | } |
281 | 78 | 95 | ||
282 | 79 | /*! | 96 | /*! |
285 | 80 | \property Document::database | 97 | The \a database is used to lookup the contents of the document, reflecting |
284 | 81 | The database is used to lookup the contents of the document, reflecting | ||
286 | 82 | changes done to it and conversely changes are saved to the database. | 98 | changes done to it and conversely changes are saved to the database. |
287 | 83 | */ | 99 | */ |
288 | 84 | void | 100 | void |
289 | @@ -104,6 +120,9 @@ | |||
290 | 104 | Q_EMIT databaseChanged(database); | 120 | Q_EMIT databaseChanged(database); |
291 | 105 | } | 121 | } |
292 | 106 | 122 | ||
293 | 123 | /*! | ||
294 | 124 | Returns the docId. | ||
295 | 125 | */ | ||
296 | 107 | QString | 126 | QString |
297 | 108 | Document::getDocId() | 127 | Document::getDocId() |
298 | 109 | { | 128 | { |
299 | @@ -111,11 +130,16 @@ | |||
300 | 111 | } | 130 | } |
301 | 112 | 131 | ||
302 | 113 | /*! | 132 | /*! |
304 | 114 | \property Document::docId | 133 | \qmlproperty string Document::docId |
305 | 115 | The docId can be that of an existing document in the database and | 134 | The docId can be that of an existing document in the database and |
306 | 116 | will determine what getContents() returns. | 135 | will determine what getContents() returns. |
307 | 117 | If no such documents exists, setDefaults() can be used to supply a preset. | 136 | If no such documents exists, setDefaults() can be used to supply a preset. |
308 | 118 | */ | 137 | */ |
309 | 138 | /*! | ||
310 | 139 | The \a docId can be that of an existing document in the database and | ||
311 | 140 | will determine what getContents() returns. | ||
312 | 141 | If no such documents exists, setDefaults() can be used to supply a preset. | ||
313 | 142 | */ | ||
314 | 119 | void | 143 | void |
315 | 120 | Document::setDocId(const QString& docId) | 144 | Document::setDocId(const QString& docId) |
316 | 121 | { | 145 | { |
317 | @@ -132,6 +156,9 @@ | |||
318 | 132 | } | 156 | } |
319 | 133 | } | 157 | } |
320 | 134 | 158 | ||
321 | 159 | /*! | ||
322 | 160 | Returns whether the document will be newly created if it doesn't exist. | ||
323 | 161 | */ | ||
324 | 135 | bool | 162 | bool |
325 | 136 | Document::getCreate() | 163 | Document::getCreate() |
326 | 137 | { | 164 | { |
327 | @@ -139,8 +166,12 @@ | |||
328 | 139 | } | 166 | } |
329 | 140 | 167 | ||
330 | 141 | /*! | 168 | /*! |
333 | 142 | \property Document::create | 169 | \qmlproperty bool Document::create |
334 | 143 | If create is true, docId is not empty and no document with the same docId | 170 | If \a create is true, docId is not empty and no document with the same docId |
335 | 171 | exists, defaults will be used to store the document. | ||
336 | 172 | */ | ||
337 | 173 | /*! | ||
338 | 174 | If \a create is true, docId is not empty and no document with the same docId | ||
339 | 144 | exists, defaults will be used to store the document. | 175 | exists, defaults will be used to store the document. |
340 | 145 | */ | 176 | */ |
341 | 146 | void | 177 | void |
342 | @@ -156,6 +187,10 @@ | |||
343 | 156 | m_database->putDoc(m_defaults, m_docId); | 187 | m_database->putDoc(m_defaults, m_docId); |
344 | 157 | } | 188 | } |
345 | 158 | 189 | ||
346 | 190 | /*! | ||
347 | 191 | Returns the defaults to be used when the document is newly created | ||
348 | 192 | because it doesn't exist, if create is true. | ||
349 | 193 | */ | ||
350 | 159 | QVariant | 194 | QVariant |
351 | 160 | Document::getDefaults() | 195 | Document::getDefaults() |
352 | 161 | { | 196 | { |
353 | @@ -163,11 +198,17 @@ | |||
354 | 163 | } | 198 | } |
355 | 164 | 199 | ||
356 | 165 | /*! | 200 | /*! |
362 | 166 | \property Document::defaults | 201 | \qmlproperty Variant Document::content |
363 | 167 | The default contents of the document, which are used only if | 202 | The default contents of the document, which are used only if |
364 | 168 | create is true, docId is not empty and no document with the same | 203 | create is true, docId is not empty and no document with the same |
365 | 169 | docId exists in the database yet. | 204 | docId exists in the database yet. |
366 | 170 | If the defaults change, it's up to the API user to handle it. | 205 | If the \a defaults change, it's up to the API user to handle it. |
367 | 206 | */ | ||
368 | 207 | /*! | ||
369 | 208 | The default contents of the document, which are used only if | ||
370 | 209 | create is true, docId is not empty and no document with the same | ||
371 | 210 | docId exists in the database yet. | ||
372 | 211 | If the \a defaults change, it's up to the API user to handle it. | ||
373 | 171 | */ | 212 | */ |
374 | 172 | void | 213 | void |
375 | 173 | Document::setDefaults(QVariant defaults) | 214 | Document::setDefaults(QVariant defaults) |
376 | @@ -185,6 +226,9 @@ | |||
377 | 185 | m_database->putDoc(m_defaults, m_docId); | 226 | m_database->putDoc(m_defaults, m_docId); |
378 | 186 | } | 227 | } |
379 | 187 | 228 | ||
380 | 229 | /*! | ||
381 | 230 | Returns the current contents of the document. | ||
382 | 231 | */ | ||
383 | 188 | QVariant | 232 | QVariant |
384 | 189 | Document::getContents() | 233 | Document::getContents() |
385 | 190 | { | 234 | { |
386 | @@ -192,8 +236,11 @@ | |||
387 | 192 | } | 236 | } |
388 | 193 | 237 | ||
389 | 194 | /*! | 238 | /*! |
392 | 195 | \property Document::contents | 239 | \qmlproperty Variant Document::contents |
393 | 196 | Updates the contents of the document. A valid docId must be set. | 240 | Updates the \a contents of the document. A valid docId must be set. |
394 | 241 | */ | ||
395 | 242 | /*! | ||
396 | 243 | Updates the \a contents of the document. A valid docId must be set. | ||
397 | 197 | */ | 244 | */ |
398 | 198 | void | 245 | void |
399 | 199 | Document::setContents(QVariant contents) | 246 | Document::setContents(QVariant contents) |
400 | 200 | 247 | ||
401 | === modified file 'src/document.h' | |||
402 | --- src/document.h 2013-04-23 15:17:24 +0000 | |||
403 | +++ src/document.h 2015-03-24 19:42:30 +0000 | |||
404 | @@ -21,7 +21,6 @@ | |||
405 | 21 | #define U1DB_DOCUMENT_H | 21 | #define U1DB_DOCUMENT_H |
406 | 22 | 22 | ||
407 | 23 | #include <QtCore/QObject> | 23 | #include <QtCore/QObject> |
408 | 24 | #include <QSqlDatabase> | ||
409 | 25 | #include <QVariant> | 24 | #include <QVariant> |
410 | 26 | 25 | ||
411 | 27 | #include "database.h" | 26 | #include "database.h" |
412 | @@ -31,13 +30,18 @@ | |||
413 | 31 | class Q_DECL_EXPORT Document : public QObject { | 30 | class Q_DECL_EXPORT Document : public QObject { |
414 | 32 | Q_OBJECT | 31 | Q_OBJECT |
415 | 33 | #ifdef Q_QDOC | 32 | #ifdef Q_QDOC |
416 | 33 | /*! database */ | ||
417 | 34 | Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) | 34 | Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) |
418 | 35 | #else | 35 | #else |
419 | 36 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) | 36 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) |
420 | 37 | #endif | 37 | #endif |
421 | 38 | /*! docId */ | ||
422 | 38 | Q_PROPERTY(QString docId READ getDocId WRITE setDocId NOTIFY docIdChanged) | 39 | Q_PROPERTY(QString docId READ getDocId WRITE setDocId NOTIFY docIdChanged) |
423 | 40 | /*! create */ | ||
424 | 39 | Q_PROPERTY(bool create READ getCreate WRITE setCreate NOTIFY createChanged) | 41 | Q_PROPERTY(bool create READ getCreate WRITE setCreate NOTIFY createChanged) |
425 | 42 | /*! defaults */ | ||
426 | 40 | Q_PROPERTY(QVariant defaults READ getDefaults WRITE setDefaults NOTIFY defaultsChanged) | 43 | Q_PROPERTY(QVariant defaults READ getDefaults WRITE setDefaults NOTIFY defaultsChanged) |
427 | 44 | /*! contents */ | ||
428 | 41 | Q_PROPERTY(QVariant contents READ getContents WRITE setContents NOTIFY contentsChanged) | 45 | Q_PROPERTY(QVariant contents READ getContents WRITE setContents NOTIFY contentsChanged) |
429 | 42 | public: | 46 | public: |
430 | 43 | Document(QObject* parent = 0); | 47 | Document(QObject* parent = 0); |
431 | @@ -53,10 +57,25 @@ | |||
432 | 53 | QVariant getContents(); | 57 | QVariant getContents(); |
433 | 54 | void setContents(QVariant contents); | 58 | void setContents(QVariant contents); |
434 | 55 | Q_SIGNALS: | 59 | Q_SIGNALS: |
435 | 60 | /*! | ||
436 | 61 | The database changed. | ||
437 | 62 | */ | ||
438 | 56 | void databaseChanged(Database* database); | 63 | void databaseChanged(Database* database); |
439 | 64 | /*! | ||
440 | 65 | The docId changed. | ||
441 | 66 | */ | ||
442 | 57 | void docIdChanged(const QString& docId); | 67 | void docIdChanged(const QString& docId); |
443 | 68 | /*! | ||
444 | 69 | The create flag changed. | ||
445 | 70 | */ | ||
446 | 58 | void createChanged(bool create); | 71 | void createChanged(bool create); |
447 | 72 | /*! | ||
448 | 73 | The default contents changed. | ||
449 | 74 | */ | ||
450 | 59 | void defaultsChanged(QVariant defaults); | 75 | void defaultsChanged(QVariant defaults); |
451 | 76 | /*! | ||
452 | 77 | The current contents of the document changed. | ||
453 | 78 | */ | ||
454 | 60 | void contentsChanged(QVariant contents); | 79 | void contentsChanged(QVariant contents); |
455 | 61 | private: | 80 | private: |
456 | 62 | Q_DISABLE_COPY(Document) | 81 | Q_DISABLE_COPY(Document) |
457 | 63 | 82 | ||
458 | === modified file 'src/index.cpp' | |||
459 | --- src/index.cpp 2014-01-31 19:20:07 +0000 | |||
460 | +++ src/index.cpp 2015-03-24 19:42:30 +0000 | |||
461 | @@ -17,13 +17,7 @@ | |||
462 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
463 | 18 | */ | 18 | */ |
464 | 19 | 19 | ||
465 | 20 | #include <QDebug> | ||
466 | 21 | #include <QSqlQuery> | ||
467 | 22 | #include <QFile> | ||
468 | 23 | #include <QSqlError> | ||
469 | 24 | #include <QUuid> | ||
470 | 25 | #include <QStringList> | 20 | #include <QStringList> |
471 | 26 | #include <QJsonDocument> | ||
472 | 27 | 21 | ||
473 | 28 | #include "index.h" | 22 | #include "index.h" |
474 | 29 | #include "private.h" | 23 | #include "private.h" |
475 | @@ -32,15 +26,33 @@ | |||
476 | 32 | 26 | ||
477 | 33 | /*! | 27 | /*! |
478 | 34 | \class Index | 28 | \class Index |
481 | 35 | \inmodule U1Db | 29 | \inmodule U1db |
482 | 36 | \ingroup modules | 30 | \ingroup cpp |
483 | 37 | 31 | ||
484 | 38 | \brief The Index class defines an index to be stored in the database and | 32 | \brief The Index class defines an index to be stored in the database and |
485 | 39 | queried using Query. Changes in documents affected by the index also update | 33 | queried using Query. Changes in documents affected by the index also update |
486 | 40 | the index in the database. | 34 | the index in the database. |
490 | 41 | 35 | */ | |
491 | 42 | This is the declarative API equivalent of Database::putIndex() and | 36 | |
492 | 43 | Database::getIndexExpressions(). | 37 | /*! |
493 | 38 | \qmltype Index | ||
494 | 39 | \instantiates Index | ||
495 | 40 | \inqmlmodule U1db 1.0 | ||
496 | 41 | \ingroup modules | ||
497 | 42 | |||
498 | 43 | \brief An Index defines what fields can be filtered using Query. | ||
499 | 44 | |||
500 | 45 | Documents in the database will be included if they contain all fields in the expression. | ||
501 | 46 | |||
502 | 47 | \qml | ||
503 | 48 | Index { | ||
504 | 49 | database: myDatabase | ||
505 | 50 | name: 'colorIndex' | ||
506 | 51 | expression: [ 'color' ] | ||
507 | 52 | } | ||
508 | 53 | \endqml | ||
509 | 54 | |||
510 | 55 | \sa Query | ||
511 | 44 | */ | 56 | */ |
512 | 45 | 57 | ||
513 | 46 | /*! | 58 | /*! |
514 | @@ -52,6 +64,9 @@ | |||
515 | 52 | { | 64 | { |
516 | 53 | } | 65 | } |
517 | 54 | 66 | ||
518 | 67 | /*! | ||
519 | 68 | Returns the \l Database to lookup documents from and store the index in. | ||
520 | 69 | */ | ||
521 | 55 | Database* | 70 | Database* |
522 | 56 | Index::getDatabase() | 71 | Index::getDatabase() |
523 | 57 | { | 72 | { |
524 | @@ -71,11 +86,16 @@ | |||
525 | 71 | } | 86 | } |
526 | 72 | 87 | ||
527 | 73 | /*! | 88 | /*! |
529 | 74 | \property Index::database | 89 | \qmlproperty Database Index::database |
530 | 75 | Sets the Database to lookup documents from and store the index in. The | 90 | Sets the Database to lookup documents from and store the index in. The |
531 | 76 | dataInvalidated() signal will be emitted on all changes that could affect | 91 | dataInvalidated() signal will be emitted on all changes that could affect |
532 | 77 | the index. | 92 | the index. |
533 | 78 | */ | 93 | */ |
534 | 94 | /*! | ||
535 | 95 | Sets the \a database to lookup documents from and store the index in. The | ||
536 | 96 | dataInvalidated() signal will be emitted on all changes that could affect | ||
537 | 97 | the index. | ||
538 | 98 | */ | ||
539 | 79 | void | 99 | void |
540 | 80 | Index::setDatabase(Database* database) | 100 | Index::setDatabase(Database* database) |
541 | 81 | { | 101 | { |
542 | @@ -98,6 +118,9 @@ | |||
543 | 98 | 118 | ||
544 | 99 | } | 119 | } |
545 | 100 | 120 | ||
546 | 121 | /*! | ||
547 | 122 | Returns the name of the index. Both name and expression must be specified. | ||
548 | 123 | */ | ||
549 | 101 | QString | 124 | QString |
550 | 102 | Index::getName() | 125 | Index::getName() |
551 | 103 | { | 126 | { |
552 | @@ -105,10 +128,14 @@ | |||
553 | 105 | } | 128 | } |
554 | 106 | 129 | ||
555 | 107 | /*! | 130 | /*! |
557 | 108 | \property Index::name | 131 | \qmlproperty string Index::name |
558 | 109 | Sets the name used. Both an expression and a name must be specified | 132 | Sets the name used. Both an expression and a name must be specified |
559 | 110 | for an index to be created. | 133 | for an index to be created. |
560 | 111 | */ | 134 | */ |
561 | 135 | /*! | ||
562 | 136 | Sets the \a name used. Both an expression and a name must be specified | ||
563 | 137 | for an index to be created. | ||
564 | 138 | */ | ||
565 | 112 | void | 139 | void |
566 | 113 | Index::setName(const QString& name) | 140 | Index::setName(const QString& name) |
567 | 114 | { | 141 | { |
568 | @@ -125,6 +152,9 @@ | |||
569 | 125 | Q_EMIT nameChanged(name); | 152 | Q_EMIT nameChanged(name); |
570 | 126 | } | 153 | } |
571 | 127 | 154 | ||
572 | 155 | /*! | ||
573 | 156 | Returns the expression of the index. Both name and expression must be specified. | ||
574 | 157 | */ | ||
575 | 128 | QStringList | 158 | QStringList |
576 | 129 | Index::getExpression() | 159 | Index::getExpression() |
577 | 130 | { | 160 | { |
578 | @@ -132,12 +162,17 @@ | |||
579 | 132 | } | 162 | } |
580 | 133 | 163 | ||
581 | 134 | /*! | 164 | /*! |
583 | 135 | \property Index::expression | 165 | \qmlproperty list<string> Index::expression |
584 | 136 | Sets the expression used. Both an expression and a name must be specified | 166 | Sets the expression used. Both an expression and a name must be specified |
585 | 137 | for an index to be created. | 167 | for an index to be created. |
586 | 138 | 168 | ||
587 | 139 | Also starts the process of creating the Index result list, which can then be queried or populate the Query model as is. | 169 | Also starts the process of creating the Index result list, which can then be queried or populate the Query model as is. |
588 | 170 | */ | ||
589 | 171 | /*! | ||
590 | 172 | Sets the \a expression used. Both an expression and a name must be specified | ||
591 | 173 | for an index to be created. | ||
592 | 140 | 174 | ||
593 | 175 | Also starts the process of creating the Index result list, which can then be queried or populate the Query model as is. | ||
594 | 141 | */ | 176 | */ |
595 | 142 | void | 177 | void |
596 | 143 | Index::setExpression(QStringList expression) | 178 | Index::setExpression(QStringList expression) |
597 | @@ -189,7 +224,6 @@ | |||
598 | 189 | /*! | 224 | /*! |
599 | 190 | \internal | 225 | \internal |
600 | 191 | */ | 226 | */ |
601 | 192 | |||
602 | 193 | QList<QVariantMap> Index::getAllResults(){ | 227 | QList<QVariantMap> Index::getAllResults(){ |
603 | 194 | generateIndexResults(); | 228 | generateIndexResults(); |
604 | 195 | return m_results; | 229 | return m_results; |
605 | @@ -205,7 +239,6 @@ | |||
606 | 205 | */ | 239 | */ |
607 | 206 | QStringList Index::appendResultsFromMap(QString docId, QStringList fieldsList, QVariantMap current_section, QString current_field) | 240 | QStringList Index::appendResultsFromMap(QString docId, QStringList fieldsList, QVariantMap current_section, QString current_field) |
608 | 207 | { | 241 | { |
609 | 208 | |||
610 | 209 | QMapIterator<QString, QVariant> i(current_section); | 242 | QMapIterator<QString, QVariant> i(current_section); |
611 | 210 | 243 | ||
612 | 211 | QString original_field = current_field; | 244 | QString original_field = current_field; |
613 | @@ -259,8 +292,6 @@ | |||
614 | 259 | *This recursive method is used in conjuntion with Index::appendResultsFromMap, to aid in iterating through a document when an embedded list is found. | 292 | *This recursive method is used in conjuntion with Index::appendResultsFromMap, to aid in iterating through a document when an embedded list is found. |
615 | 260 | * | 293 | * |
616 | 261 | */ | 294 | */ |
617 | 262 | |||
618 | 263 | |||
619 | 264 | QStringList Index::getFieldsFromList(QString docId, QStringList fieldsList, QVariantList current_section, QString current_field) | 295 | QStringList Index::getFieldsFromList(QString docId, QStringList fieldsList, QVariantList current_section, QString current_field) |
620 | 265 | { | 296 | { |
621 | 266 | 297 | ||
622 | 267 | 298 | ||
623 | === modified file 'src/index.h' | |||
624 | --- src/index.h 2013-04-25 13:38:33 +0000 | |||
625 | +++ src/index.h 2015-03-24 19:42:30 +0000 | |||
626 | @@ -21,7 +21,6 @@ | |||
627 | 21 | #define U1DB_INDEX_H | 21 | #define U1DB_INDEX_H |
628 | 22 | 22 | ||
629 | 23 | #include <QtCore/QObject> | 23 | #include <QtCore/QObject> |
630 | 24 | #include <QSqlDatabase> | ||
631 | 25 | #include <QStringList> | 24 | #include <QStringList> |
632 | 26 | 25 | ||
633 | 27 | #include "database.h" | 26 | #include "database.h" |
634 | @@ -31,11 +30,14 @@ | |||
635 | 31 | class Q_DECL_EXPORT Index : public QObject { | 30 | class Q_DECL_EXPORT Index : public QObject { |
636 | 32 | Q_OBJECT | 31 | Q_OBJECT |
637 | 33 | #ifdef Q_QDOC | 32 | #ifdef Q_QDOC |
638 | 33 | /*! database */ | ||
639 | 34 | Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) | 34 | Q_PROPERTY(Database* database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) |
640 | 35 | #else | 35 | #else |
641 | 36 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) | 36 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) database READ getDatabase WRITE setDatabase NOTIFY databaseChanged) |
642 | 37 | #endif | 37 | #endif |
643 | 38 | /*! name */ | ||
644 | 38 | Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged) | 39 | Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged) |
645 | 40 | /*! expression */ | ||
646 | 39 | Q_PROPERTY(QStringList expression READ getExpression WRITE setExpression NOTIFY expressionChanged) | 41 | Q_PROPERTY(QStringList expression READ getExpression WRITE setExpression NOTIFY expressionChanged) |
647 | 40 | public: | 42 | public: |
648 | 41 | Index(QObject* parent = 0); | 43 | Index(QObject* parent = 0); |
649 | @@ -49,8 +51,17 @@ | |||
650 | 49 | QList<QVariantMap> getAllResults(); | 51 | QList<QVariantMap> getAllResults(); |
651 | 50 | 52 | ||
652 | 51 | Q_SIGNALS: | 53 | Q_SIGNALS: |
653 | 54 | /*! | ||
654 | 55 | The database changed. | ||
655 | 56 | */ | ||
656 | 52 | void databaseChanged(Database* database); | 57 | void databaseChanged(Database* database); |
657 | 58 | /*! | ||
658 | 59 | The index name changed. | ||
659 | 60 | */ | ||
660 | 53 | void nameChanged(const QString& name); | 61 | void nameChanged(const QString& name); |
661 | 62 | /*! | ||
662 | 63 | The index expression changed. | ||
663 | 64 | */ | ||
664 | 54 | void expressionChanged(QVariant expression); | 65 | void expressionChanged(QVariant expression); |
665 | 55 | /*! | 66 | /*! |
666 | 56 | The database, an indexed document or the expressions changed. | 67 | The database, an indexed document or the expressions changed. |
667 | 57 | 68 | ||
668 | === modified file 'src/query.cpp' | |||
669 | --- src/query.cpp 2014-03-13 19:31:58 +0000 | |||
670 | +++ src/query.cpp 2015-03-24 19:42:30 +0000 | |||
671 | @@ -17,13 +17,7 @@ | |||
672 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
673 | 18 | */ | 18 | */ |
674 | 19 | 19 | ||
675 | 20 | #include <QDebug> | ||
676 | 21 | #include <QSqlQuery> | ||
677 | 22 | #include <QFile> | ||
678 | 23 | #include <QSqlError> | ||
679 | 24 | #include <QUuid> | ||
680 | 25 | #include <QStringList> | 20 | #include <QStringList> |
681 | 26 | #include <QJsonDocument> | ||
682 | 27 | 21 | ||
683 | 28 | #include "query.h" | 22 | #include "query.h" |
684 | 29 | #include "database.h" | 23 | #include "database.h" |
685 | @@ -34,12 +28,42 @@ | |||
686 | 34 | /*! | 28 | /*! |
687 | 35 | \class Query | 29 | \class Query |
688 | 36 | \inmodule U1db | 30 | \inmodule U1db |
690 | 37 | \ingroup modules | 31 | \ingroup cpp |
691 | 38 | 32 | ||
692 | 39 | \brief The Query class generates a filtered list of documents based on a query using the given Index. | 33 | \brief The Query class generates a filtered list of documents based on a query using the given Index. |
693 | 40 | 34 | ||
694 | 41 | Query can be used as a QAbstractListModel, delegates will then have access to \a docId and \a contents | 35 | Query can be used as a QAbstractListModel, delegates will then have access to \a docId and \a contents |
695 | 42 | analogous to the properties of Document. | 36 | analogous to the properties of Document. |
696 | 37 | */ | ||
697 | 38 | |||
698 | 39 | /*! | ||
699 | 40 | \qmltype Query | ||
700 | 41 | \instantiates Query | ||
701 | 42 | \inqmlmodule U1db 1.0 | ||
702 | 43 | \ingroup modules | ||
703 | 44 | |||
704 | 45 | \brief Query filters documents based on the query and index. | ||
705 | 46 | |||
706 | 47 | In a ListView the Query can be used as a model. | ||
707 | 48 | |||
708 | 49 | \qml | ||
709 | 50 | ListView { | ||
710 | 51 | model: Query { | ||
711 | 52 | index: Index { | ||
712 | 53 | name: 'colorIndex' | ||
713 | 54 | expression: [ 'color' ] | ||
714 | 55 | database: myDatabase | ||
715 | 56 | } | ||
716 | 57 | query: [ 'blue' ] | ||
717 | 58 | } | ||
718 | 59 | delegate: ListItem.Subtitled { | ||
719 | 60 | text: docId | ||
720 | 61 | subText: contents.color | ||
721 | 62 | } | ||
722 | 63 | } | ||
723 | 64 | \endqml | ||
724 | 65 | |||
725 | 66 | \sa Index | ||
726 | 43 | */ | 67 | */ |
727 | 44 | 68 | ||
728 | 45 | /*! | 69 | /*! |
729 | @@ -93,6 +117,9 @@ | |||
730 | 93 | return m_results.count(); | 117 | return m_results.count(); |
731 | 94 | } | 118 | } |
732 | 95 | 119 | ||
733 | 120 | /*! | ||
734 | 121 | FIXME | ||
735 | 122 | */ | ||
736 | 96 | Index* | 123 | Index* |
737 | 97 | Query::getIndex() | 124 | Query::getIndex() |
738 | 98 | { | 125 | { |
739 | @@ -287,10 +314,13 @@ | |||
740 | 287 | } | 314 | } |
741 | 288 | 315 | ||
742 | 289 | /*! | 316 | /*! |
745 | 290 | \property Query::index | 317 | \qmlproperty Index Query::index |
746 | 291 | Sets the Index to use. The index must have a valid name and index expressions. | 318 | Sets the Index to use. \a index must have a valid name and index expressions. |
747 | 292 | If no query is set, the default is all results of the index. | 319 | If no query is set, the default is all results of the index. |
748 | 293 | */ | 320 | */ |
749 | 321 | /*! | ||
750 | 322 | FIXME \a index | ||
751 | 323 | */ | ||
752 | 294 | void | 324 | void |
753 | 295 | Query::setIndex(Index* index) | 325 | Query::setIndex(Index* index) |
754 | 296 | { | 326 | { |
755 | @@ -305,11 +335,12 @@ | |||
756 | 305 | } | 335 | } |
757 | 306 | Q_EMIT indexChanged(index); | 336 | Q_EMIT indexChanged(index); |
758 | 307 | 337 | ||
759 | 308 | |||
760 | 309 | onDataInvalidated(); | 338 | onDataInvalidated(); |
761 | 310 | |||
762 | 311 | } | 339 | } |
763 | 312 | 340 | ||
764 | 341 | /*! | ||
765 | 342 | FIXME | ||
766 | 343 | */ | ||
767 | 313 | QVariant | 344 | QVariant |
768 | 314 | Query::getQuery() | 345 | Query::getQuery() |
769 | 315 | { | 346 | { |
770 | @@ -317,11 +348,14 @@ | |||
771 | 317 | } | 348 | } |
772 | 318 | 349 | ||
773 | 319 | /*! | 350 | /*! |
775 | 320 | \property Query::query | 351 | \qmlproperty Variant Query::query |
776 | 321 | A query in one of the allowed forms: | 352 | A query in one of the allowed forms: |
777 | 322 | 'value', ['value'] or [{'sub-field': 'value'}]. | 353 | 'value', ['value'] or [{'sub-field': 'value'}]. |
778 | 323 | The default is equivalent to '*'. | 354 | The default is equivalent to '*'. |
779 | 324 | */ | 355 | */ |
780 | 356 | /*! | ||
781 | 357 | FIXME \a query | ||
782 | 358 | */ | ||
783 | 325 | void | 359 | void |
784 | 326 | Query::setQuery(QVariant query) | 360 | Query::setQuery(QVariant query) |
785 | 327 | { | 361 | { |
786 | @@ -334,9 +368,12 @@ | |||
787 | 334 | } | 368 | } |
788 | 335 | 369 | ||
789 | 336 | /*! | 370 | /*! |
791 | 337 | \property Query::documents | 371 | \qmlproperty list<string> Query::documents |
792 | 338 | The docId's of all matched documents. | 372 | The docId's of all matched documents. |
793 | 339 | */ | 373 | */ |
794 | 374 | /*! | ||
795 | 375 | FIXME | ||
796 | 376 | */ | ||
797 | 340 | QStringList | 377 | QStringList |
798 | 341 | Query::getDocuments() | 378 | Query::getDocuments() |
799 | 342 | { | 379 | { |
800 | @@ -344,9 +381,12 @@ | |||
801 | 344 | } | 381 | } |
802 | 345 | 382 | ||
803 | 346 | /*! | 383 | /*! |
805 | 347 | \property Query::results | 384 | \qmlproperty list<Variant> Query::results |
806 | 348 | The results of the query as a list. | 385 | The results of the query as a list. |
807 | 349 | */ | 386 | */ |
808 | 387 | /*! | ||
809 | 388 | FIXME | ||
810 | 389 | */ | ||
811 | 350 | QList<QVariant> | 390 | QList<QVariant> |
812 | 351 | Query::getResults() | 391 | Query::getResults() |
813 | 352 | { | 392 | { |
814 | 353 | 393 | ||
815 | === modified file 'src/query.h' | |||
816 | --- src/query.h 2014-03-07 17:54:07 +0000 | |||
817 | +++ src/query.h 2015-03-24 19:42:30 +0000 | |||
818 | @@ -30,12 +30,16 @@ | |||
819 | 30 | class Q_DECL_EXPORT Query : public QAbstractListModel { | 30 | class Q_DECL_EXPORT Query : public QAbstractListModel { |
820 | 31 | Q_OBJECT | 31 | Q_OBJECT |
821 | 32 | #ifdef Q_QDOC | 32 | #ifdef Q_QDOC |
822 | 33 | /*! index */ | ||
823 | 33 | Q_PROPERTY(Index* index READ getIndex WRITE setIndex NOTIFY indexChanged) | 34 | Q_PROPERTY(Index* index READ getIndex WRITE setIndex NOTIFY indexChanged) |
824 | 34 | #else | 35 | #else |
825 | 35 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Index*) index READ getIndex WRITE setIndex NOTIFY indexChanged) | 36 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Index*) index READ getIndex WRITE setIndex NOTIFY indexChanged) |
826 | 36 | #endif | 37 | #endif |
827 | 38 | /*! query */ | ||
828 | 37 | Q_PROPERTY(QVariant query READ getQuery WRITE setQuery NOTIFY queryChanged) | 39 | Q_PROPERTY(QVariant query READ getQuery WRITE setQuery NOTIFY queryChanged) |
829 | 40 | /*! documents */ | ||
830 | 38 | Q_PROPERTY(QStringList documents READ getDocuments NOTIFY documentsChanged) | 41 | Q_PROPERTY(QStringList documents READ getDocuments NOTIFY documentsChanged) |
831 | 42 | /*! results */ | ||
832 | 39 | Q_PROPERTY(QList<QVariant> results READ getResults NOTIFY resultsChanged) | 43 | Q_PROPERTY(QList<QVariant> results READ getResults NOTIFY resultsChanged) |
833 | 40 | public: | 44 | public: |
834 | 41 | Query(QObject* parent = 0); | 45 | Query(QObject* parent = 0); |
835 | @@ -55,9 +59,21 @@ | |||
836 | 55 | void resetModel(); | 59 | void resetModel(); |
837 | 56 | 60 | ||
838 | 57 | Q_SIGNALS: | 61 | Q_SIGNALS: |
839 | 62 | /*! | ||
840 | 63 | The associated index changed. | ||
841 | 64 | */ | ||
842 | 58 | void indexChanged(Index* index); | 65 | void indexChanged(Index* index); |
843 | 66 | /*! | ||
844 | 67 | The query changed. | ||
845 | 68 | */ | ||
846 | 59 | void queryChanged(QVariant query); | 69 | void queryChanged(QVariant query); |
847 | 70 | /*! | ||
848 | 71 | The documents matching the query changed. | ||
849 | 72 | */ | ||
850 | 60 | void documentsChanged(QStringList documents); | 73 | void documentsChanged(QStringList documents); |
851 | 74 | /*! | ||
852 | 75 | The results matching the query changed. | ||
853 | 76 | */ | ||
854 | 61 | void resultsChanged(QList<QVariant> results); | 77 | void resultsChanged(QList<QVariant> results); |
855 | 62 | private: | 78 | private: |
856 | 63 | Q_DISABLE_COPY(Query) | 79 | Q_DISABLE_COPY(Query) |
857 | 64 | 80 | ||
858 | === modified file 'src/synchronizer.cpp' | |||
859 | --- src/synchronizer.cpp 2013-11-25 13:22:07 +0000 | |||
860 | +++ src/synchronizer.cpp 2015-03-24 19:42:30 +0000 | |||
861 | @@ -17,7 +17,6 @@ | |||
862 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
863 | 18 | */ | 18 | */ |
864 | 19 | 19 | ||
865 | 20 | #include <QDebug> | ||
866 | 21 | #include <QSqlQuery> | 20 | #include <QSqlQuery> |
867 | 22 | #include <QFile> | 21 | #include <QFile> |
868 | 23 | #include <QSqlError> | 22 | #include <QSqlError> |
869 | @@ -33,10 +32,34 @@ | |||
870 | 33 | /*! | 32 | /*! |
871 | 34 | \class Synchronizer | 33 | \class Synchronizer |
872 | 35 | \inmodule U1Db | 34 | \inmodule U1Db |
873 | 35 | \ingroup cpp | ||
874 | 36 | |||
875 | 37 | \brief The Synchronizer class handles synchronizing between two databases. | ||
876 | 38 | */ | ||
877 | 39 | |||
878 | 40 | /*! | ||
879 | 41 | \qmltype Synchronizer | ||
880 | 42 | \instantiates Synchronizer | ||
881 | 43 | \inqmlmodule U1db 1.0 | ||
882 | 36 | \ingroup modules | 44 | \ingroup modules |
883 | 37 | 45 | ||
886 | 38 | \brief The Synchronizer class handles synchronizing between two databases. | 46 | \brief Synchronizer handles synchronizing between two databases. |
887 | 39 | 47 | ||
888 | 48 | \qml | ||
889 | 49 | Synchronizer { | ||
890 | 50 | id: mySync | ||
891 | 51 | synchronize: false | ||
892 | 52 | source: myDatabase | ||
893 | 53 | targets: [ { | ||
894 | 54 | remote: true, | ||
895 | 55 | ip: "127.0.0.1", | ||
896 | 56 | port: 7777, | ||
897 | 57 | name: "example1.u1db", | ||
898 | 58 | resolve_to_source: true | ||
899 | 59 | } ] | ||
900 | 60 | |||
901 | 61 | } | ||
902 | 62 | \endqml | ||
903 | 40 | */ | 63 | */ |
904 | 41 | 64 | ||
905 | 42 | /* | 65 | /* |
906 | @@ -50,20 +73,6 @@ | |||
907 | 50 | 73 | ||
908 | 51 | Synchronizer elements sync two databases together, a 'source' database and a remote or local 'target' database. | 74 | Synchronizer elements sync two databases together, a 'source' database and a remote or local 'target' database. |
909 | 52 | 75 | ||
910 | 53 | Example use in a QML application: | ||
911 | 54 | |||
912 | 55 | U1db.Synchronizer{ | ||
913 | 56 | id: aSynchronizer | ||
914 | 57 | synchronize: false | ||
915 | 58 | source: aDatabase | ||
916 | 59 | targets: [{remote:true, | ||
917 | 60 | ip:"127.0.0.1", | ||
918 | 61 | port: 7777, | ||
919 | 62 | name:"example1.u1db", | ||
920 | 63 | resolve_to_source:true}] | ||
921 | 64 | |||
922 | 65 | } | ||
923 | 66 | |||
924 | 67 | Short description of properties: | 76 | Short description of properties: |
925 | 68 | 77 | ||
926 | 69 | id: The element's identification. | 78 | id: The element's identification. |
927 | @@ -152,12 +161,8 @@ | |||
928 | 152 | return roles; | 161 | return roles; |
929 | 153 | } | 162 | } |
930 | 154 | 163 | ||
931 | 155 | |||
932 | 156 | /*! | 164 | /*! |
937 | 157 | 165 | Sets the \a source database. | |
934 | 158 | |||
935 | 159 | Sets the source database. | ||
936 | 160 | |||
938 | 161 | */ | 166 | */ |
939 | 162 | void Synchronizer::setSource(Database* source) | 167 | void Synchronizer::setSource(Database* source) |
940 | 163 | { | 168 | { |
941 | @@ -173,15 +178,16 @@ | |||
942 | 173 | Q_EMIT sourceChanged(source); | 178 | Q_EMIT sourceChanged(source); |
943 | 174 | } | 179 | } |
944 | 175 | 180 | ||
945 | 176 | |||
946 | 177 | /*! | 181 | /*! |
948 | 178 | * \property Synchronizer::targets | 182 | * \qmlproperty Variant Synchronizer::targets |
949 | 183 | * \preliminary | ||
950 | 179 | * | 184 | * |
951 | 180 | * Sets meta-data for databases to be used during a synchronization session. | 185 | * Sets meta-data for databases to be used during a synchronization session. |
952 | 181 | * | 186 | * |
953 | 182 | * The QVariant is a list that can contain definitions for more than one database | 187 | * The QVariant is a list that can contain definitions for more than one database |
954 | 183 | * to be used as a target. For example: | 188 | * to be used as a target. For example: |
955 | 184 | * | 189 | * |
956 | 190 | * \code | ||
957 | 185 | * targets: [{remote:true}, | 191 | * targets: [{remote:true}, |
958 | 186 | * {remote:true, | 192 | * {remote:true, |
959 | 187 | * ip:"127.0.0.1", | 193 | * ip:"127.0.0.1", |
960 | @@ -189,6 +195,7 @@ | |||
961 | 189 | * name:"example1.u1db", | 195 | * name:"example1.u1db", |
962 | 190 | * resolve_to_source:true}, | 196 | * resolve_to_source:true}, |
963 | 191 | * {remote:"OK"}] | 197 | * {remote:"OK"}] |
964 | 198 | * \endcode | ||
965 | 192 | * | 199 | * |
966 | 193 | * The above example defines three databases. Two of the three definitions in the | 200 | * The above example defines three databases. Two of the three definitions in the |
967 | 194 | * example are invalid, the first ({remote:true}) and the third ({remote:"OK"}), | 201 | * example are invalid, the first ({remote:true}) and the third ({remote:"OK"}), |
968 | @@ -197,11 +204,13 @@ | |||
969 | 197 | * The second definition is a fully defined and valid definition for a local to | 204 | * The second definition is a fully defined and valid definition for a local to |
970 | 198 | * remote synchronization of two databases: | 205 | * remote synchronization of two databases: |
971 | 199 | * | 206 | * |
972 | 207 | * \code | ||
973 | 200 | * {remote:true, | 208 | * {remote:true, |
974 | 201 | * ip:"127.0.0.1", | 209 | * ip:"127.0.0.1", |
975 | 202 | * port: 7777, | 210 | * port: 7777, |
976 | 203 | * name:"example1.u1db", | 211 | * name:"example1.u1db", |
977 | 204 | * resolve_to_source:true} | 212 | * resolve_to_source:true} |
978 | 213 | * \endcode | ||
979 | 205 | * | 214 | * |
980 | 206 | * 'remote' determines whether the database is on disk or located on a server. | 215 | * 'remote' determines whether the database is on disk or located on a server. |
981 | 207 | * 'ip' and 'port' for a server are used only when 'remote' is set to true | 216 | * 'ip' and 'port' for a server are used only when 'remote' is set to true |
982 | @@ -209,9 +218,10 @@ | |||
983 | 209 | * Note: If 'remote' is false this is the relative/absolute file location. | 218 | * Note: If 'remote' is false this is the relative/absolute file location. |
984 | 210 | * 'resolve_to_source' determines whether to resolve conflicts automatically | 219 | * 'resolve_to_source' determines whether to resolve conflicts automatically |
985 | 211 | * in favor of the source (aka local) database's values or the target's. | 220 | * in favor of the source (aka local) database's values or the target's. |
989 | 212 | * | 221 | */ |
990 | 213 | */ | 222 | /*! |
991 | 214 | 223 | * FIXME \a targets | |
992 | 224 | */ | ||
993 | 215 | void Synchronizer::setTargets(QVariant targets) | 225 | void Synchronizer::setTargets(QVariant targets) |
994 | 216 | { | 226 | { |
995 | 217 | 227 | ||
996 | @@ -226,9 +236,12 @@ | |||
997 | 226 | } | 236 | } |
998 | 227 | 237 | ||
999 | 228 | /*! | 238 | /*! |
1003 | 229 | * \property Synchronizer::synchronize | 239 | * \qmlproperty bool Synchronizer::synchronize |
1004 | 230 | */ | 240 | * FIXME |
1005 | 231 | 241 | */ | |
1006 | 242 | /*! | ||
1007 | 243 | * FIXME \a synchronize | ||
1008 | 244 | */ | ||
1009 | 232 | void Synchronizer::setSync(bool synchronize) | 245 | void Synchronizer::setSync(bool synchronize) |
1010 | 233 | { | 246 | { |
1011 | 234 | 247 | ||
1012 | @@ -241,9 +254,15 @@ | |||
1013 | 241 | 254 | ||
1014 | 242 | 255 | ||
1015 | 243 | /*! | 256 | /*! |
1019 | 244 | * \property Synchronizer::resolve_to_source | 257 | * \qmlproperty bool Synchronizer::resolve_to_source |
1020 | 245 | */ | 258 | * |
1021 | 246 | 259 | * If true, conflicts during sync will be resolved in favor of the content | |
1022 | 260 | * from the source database. | ||
1023 | 261 | */ | ||
1024 | 262 | /*! | ||
1025 | 263 | * If \a resolve_to_source is true, conflicts during sync will be resolved in favor | ||
1026 | 264 | * of the content from the source database. | ||
1027 | 265 | */ | ||
1028 | 247 | void Synchronizer::setResolveToSource(bool resolve_to_source) | 266 | void Synchronizer::setResolveToSource(bool resolve_to_source) |
1029 | 248 | { | 267 | { |
1030 | 249 | if (m_resolve_to_source == resolve_to_source) | 268 | if (m_resolve_to_source == resolve_to_source) |
1031 | @@ -255,8 +274,6 @@ | |||
1032 | 255 | 274 | ||
1033 | 256 | 275 | ||
1034 | 257 | /*! | 276 | /*! |
1035 | 258 | * \fn void Synchronizer::setSyncOutput(QList<QVariant> sync_output) | ||
1036 | 259 | * | ||
1037 | 260 | * Sets the current value for the active session's \a sync_output. | 277 | * Sets the current value for the active session's \a sync_output. |
1038 | 261 | * | 278 | * |
1039 | 262 | */ | 279 | */ |
1040 | @@ -271,11 +288,12 @@ | |||
1041 | 271 | } | 288 | } |
1042 | 272 | 289 | ||
1043 | 273 | /*! | 290 | /*! |
1049 | 274 | * \property Synchronizer::source | 291 | * \qmlproperty Database Synchronizer::source |
1050 | 275 | * | 292 | * |
1051 | 276 | * | 293 | * Returns the source \l Database. |
1052 | 277 | * Returns a source Database. | 294 | */ |
1053 | 278 | * | 295 | /*! |
1054 | 296 | Returns the source \l Database. | ||
1055 | 279 | */ | 297 | */ |
1056 | 280 | Database* Synchronizer::getSource() | 298 | Database* Synchronizer::getSource() |
1057 | 281 | { | 299 | { |
1058 | @@ -283,54 +301,36 @@ | |||
1059 | 283 | } | 301 | } |
1060 | 284 | 302 | ||
1061 | 285 | /*! | 303 | /*! |
1062 | 286 | * \brief Synchronizer::getTargets | ||
1063 | 287 | * | ||
1064 | 288 | * | ||
1065 | 289 | * Returns meta-data for all target databases. | 304 | * Returns meta-data for all target databases. |
1066 | 290 | * | ||
1067 | 291 | */ | 305 | */ |
1068 | 292 | |||
1069 | 293 | QVariant Synchronizer::getTargets() | 306 | QVariant Synchronizer::getTargets() |
1070 | 294 | { | 307 | { |
1071 | 295 | return m_targets; | 308 | return m_targets; |
1072 | 296 | } | 309 | } |
1073 | 297 | 310 | ||
1074 | 298 | /*! | 311 | /*! |
1075 | 299 | * \brief Synchronizer::getSync | ||
1076 | 300 | * | ||
1077 | 301 | * | ||
1078 | 302 | * Returns the current value of synchronize. If true then the synchronize | 312 | * Returns the current value of synchronize. If true then the synchronize |
1079 | 303 | * session is initiated. | 313 | * session is initiated. |
1080 | 304 | * | 314 | * |
1081 | 305 | * This should probaby always be set to false on application start up. | 315 | * This should probaby always be set to false on application start up. |
1082 | 306 | * The application developer should use some trigger to switch it to true | 316 | * The application developer should use some trigger to switch it to true |
1083 | 307 | * when needed (e.g. button click). | 317 | * when needed (e.g. button click). |
1084 | 308 | * | ||
1085 | 309 | */ | 318 | */ |
1086 | 310 | |||
1087 | 311 | bool Synchronizer::getSync() | 319 | bool Synchronizer::getSync() |
1088 | 312 | { | 320 | { |
1089 | 313 | return m_synchronize; | 321 | return m_synchronize; |
1090 | 314 | } | 322 | } |
1091 | 315 | 323 | ||
1092 | 316 | /*! | 324 | /*! |
1101 | 317 | * \brief Synchronizer::getResolveToSource | 325 | * Returns \b true if conflicts during sync will be resolved in favor of the content |
1102 | 318 | * | 326 | * from the source database. |
1095 | 319 | * | ||
1096 | 320 | * If set to true, any document conflicts created during a sync session | ||
1097 | 321 | * will be resolved in favor of the content from the source database. If false | ||
1098 | 322 | * the content from the target database will replace the document content in | ||
1099 | 323 | * the source database. | ||
1100 | 324 | * | ||
1103 | 325 | */ | 327 | */ |
1104 | 326 | |||
1105 | 327 | bool Synchronizer::getResolveToSource(){ | 328 | bool Synchronizer::getResolveToSource(){ |
1106 | 328 | return m_resolve_to_source; | 329 | return m_resolve_to_source; |
1107 | 329 | } | 330 | } |
1108 | 330 | 331 | ||
1109 | 331 | /*! | 332 | /*! |
1112 | 332 | * \property Synchronizer::sync_output | 333 | * \qmlproperty list<Variant> Synchronizer::sync_output |
1111 | 333 | * \brief Synchronizer::getSyncOutput | ||
1113 | 334 | * | 334 | * |
1114 | 335 | * Returns the output from a sync session. The list should contain numerous | 335 | * Returns the output from a sync session. The list should contain numerous |
1115 | 336 | * QVariantMaps, each of which will have various meta-data with informative | 336 | * QVariantMaps, each of which will have various meta-data with informative |
1116 | @@ -343,19 +343,18 @@ | |||
1117 | 343 | * The information can be used in any number of ways, such as on screen within an app, | 343 | * The information can be used in any number of ways, such as on screen within an app, |
1118 | 344 | * testing, console output, logs and more. This is designed to be flexible enough that | 344 | * testing, console output, logs and more. This is designed to be flexible enough that |
1119 | 345 | * the app developer can decide themselves how to best use the data. | 345 | * the app developer can decide themselves how to best use the data. |
1123 | 346 | * | 346 | */ |
1124 | 347 | */ | 347 | /*! |
1125 | 348 | 348 | * FIXME | |
1126 | 349 | */ | ||
1127 | 349 | QList<QVariant> Synchronizer::getSyncOutput(){ | 350 | QList<QVariant> Synchronizer::getSyncOutput(){ |
1128 | 350 | return m_sync_output; | 351 | return m_sync_output; |
1129 | 351 | } | 352 | } |
1130 | 352 | 353 | ||
1131 | 353 | /* | 354 | /* |
1132 | 354 | |||
1133 | 355 | Below this line represents the class' more unique functionality. | 355 | Below this line represents the class' more unique functionality. |
1134 | 356 | In other words, methods that do more than simply modify/retrieve | 356 | In other words, methods that do more than simply modify/retrieve |
1135 | 357 | an element's property values. | 357 | an element's property values. |
1136 | 358 | |||
1137 | 359 | */ | 358 | */ |
1138 | 360 | 359 | ||
1139 | 361 | 360 | ||
1140 | @@ -363,7 +362,6 @@ | |||
1141 | 363 | * \brief Synchronizer::onSyncChanged | 362 | * \brief Synchronizer::onSyncChanged |
1142 | 364 | * | 363 | * |
1143 | 365 | * The synchroization process begins here. | 364 | * The synchroization process begins here. |
1144 | 366 | * | ||
1145 | 367 | */ | 365 | */ |
1146 | 368 | 366 | ||
1147 | 369 | void Synchronizer::onSyncChanged(bool synchronize){ | 367 | void Synchronizer::onSyncChanged(bool synchronize){ |
1148 | @@ -446,12 +444,10 @@ | |||
1149 | 446 | * \internal | 444 | * \internal |
1150 | 447 | * \brief Synchronizer::getValidTargets | 445 | * \brief Synchronizer::getValidTargets |
1151 | 448 | * | 446 | * |
1152 | 449 | * | ||
1153 | 450 | * This method confirms that each sync target definition is valid, based | 447 | * This method confirms that each sync target definition is valid, based |
1154 | 451 | * on predefined criteria contained in the validator and mandatory lists. | 448 | * on predefined criteria contained in the validator and mandatory lists. |
1155 | 452 | * | 449 | * |
1156 | 453 | */ | 450 | */ |
1157 | 454 | |||
1158 | 455 | QList<QVariant> Synchronizer::getValidTargets(QMap<QString,QString>validator, QList<QString>mandatory){ | 451 | QList<QVariant> Synchronizer::getValidTargets(QMap<QString,QString>validator, QList<QString>mandatory){ |
1159 | 456 | 452 | ||
1160 | 457 | QList<QVariant> sync_targets; | 453 | QList<QVariant> sync_targets; |
1161 | @@ -1018,7 +1014,7 @@ | |||
1162 | 1018 | return dbUid; | 1014 | return dbUid; |
1163 | 1019 | } | 1015 | } |
1164 | 1020 | else{ | 1016 | else{ |
1166 | 1021 | qDebug() << query.lastError().text(); | 1017 | qWarning("u1db: %s", qPrintable(query.lastError().text())); |
1167 | 1022 | db.close(); | 1018 | db.close(); |
1168 | 1023 | return dbUid; | 1019 | return dbUid; |
1169 | 1024 | } | 1020 | } |
1170 | 1025 | 1021 | ||
1171 | === modified file 'src/synchronizer.h' | |||
1172 | --- src/synchronizer.h 2013-11-22 15:21:37 +0000 | |||
1173 | +++ src/synchronizer.h 2015-03-24 19:42:30 +0000 | |||
1174 | @@ -21,11 +21,8 @@ | |||
1175 | 21 | #define U1DB_SYNCHRONIZER_H | 21 | #define U1DB_SYNCHRONIZER_H |
1176 | 22 | 22 | ||
1177 | 23 | #include <QtCore/QObject> | 23 | #include <QtCore/QObject> |
1178 | 24 | #include <QSqlDatabase> | ||
1179 | 25 | #include <QVariant> | 24 | #include <QVariant> |
1180 | 26 | #include <QMetaType> | ||
1181 | 27 | #include <QtNetwork> | 25 | #include <QtNetwork> |
1182 | 28 | #include <QNetworkAccessManager> | ||
1183 | 29 | 26 | ||
1184 | 30 | 27 | ||
1185 | 31 | #include "database.h" | 28 | #include "database.h" |
1186 | @@ -37,13 +34,18 @@ | |||
1187 | 37 | class Q_DECL_EXPORT Synchronizer : public QAbstractListModel { | 34 | class Q_DECL_EXPORT Synchronizer : public QAbstractListModel { |
1188 | 38 | Q_OBJECT | 35 | Q_OBJECT |
1189 | 39 | #ifdef Q_QDOC | 36 | #ifdef Q_QDOC |
1190 | 37 | /*! source */ | ||
1191 | 40 | Q_PROPERTY(Database* source READ getSource WRITE setSource NOTIFY sourceChanged) | 38 | Q_PROPERTY(Database* source READ getSource WRITE setSource NOTIFY sourceChanged) |
1192 | 41 | #else | 39 | #else |
1193 | 42 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) source READ getSource WRITE setSource NOTIFY sourceChanged) | 40 | Q_PROPERTY(QT_PREPEND_NAMESPACE_U1DB(Database*) source READ getSource WRITE setSource NOTIFY sourceChanged) |
1194 | 43 | #endif | 41 | #endif |
1195 | 42 | /*! synchronize */ | ||
1196 | 44 | Q_PROPERTY(bool synchronize READ getSync WRITE setSync NOTIFY syncChanged) | 43 | Q_PROPERTY(bool synchronize READ getSync WRITE setSync NOTIFY syncChanged) |
1197 | 44 | /*! resolve_to_source */ | ||
1198 | 45 | Q_PROPERTY(bool resolve_to_source READ getResolveToSource WRITE setResolveToSource NOTIFY resolveToSourceChanged) | 45 | Q_PROPERTY(bool resolve_to_source READ getResolveToSource WRITE setResolveToSource NOTIFY resolveToSourceChanged) |
1199 | 46 | /*! targets */ | ||
1200 | 46 | Q_PROPERTY(QVariant targets READ getTargets WRITE setTargets NOTIFY targetsChanged) | 47 | Q_PROPERTY(QVariant targets READ getTargets WRITE setTargets NOTIFY targetsChanged) |
1201 | 48 | /*! sync_output */ | ||
1202 | 47 | Q_PROPERTY(QList<QVariant> sync_output READ getSyncOutput NOTIFY syncOutputChanged) | 49 | Q_PROPERTY(QList<QVariant> sync_output READ getSyncOutput NOTIFY syncOutputChanged) |
1203 | 48 | 50 | ||
1204 | 49 | public: | 51 | public: |
FAILED: Continuous integration, rev:113 jenkins. qa.ubuntu. com/job/ u1db-qt- ci/40/ jenkins. qa.ubuntu. com/job/ u1db-qt- precise- amd64-ci/ 40/console jenkins. qa.ubuntu. com/job/ u1db-qt- saucy-amd64- ci/42/console jenkins. qa.ubuntu. com/job/ u1db-qt- trusty- amd64-ci/ 20/console jenkins. qa.ubuntu. com/job/ u1db-qt- trusty- armhf-ci/ 20/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/u1db- qt-ci/40/ rebuild
http://