Merge lp:~renatofilho/address-book-app/dynamic-backend into lp:address-book-app
- dynamic-backend
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Francis Ginther |
Approved revision: | 110 |
Merged at revision: | 108 |
Proposed branch: | lp:~renatofilho/address-book-app/dynamic-backend |
Merge into: | lp:address-book-app |
Diff against target: |
387 lines (+109/-39) 14 files modified
CMakeLists.txt (+12/-12) src/app/addressbookapp.cpp (+9/-0) src/imports/Common/ContactDetailGroupBase.qml (+21/-2) src/imports/ContactEdit/ContactDetailWithTypeEditor.qml (+4/-2) src/imports/ContactList/ContactListPage.qml (+1/-0) src/imports/ContactView/CMakeLists.txt (+0/-1) src/imports/ContactView/ContactDetailGroupWithTypeView.qml (+1/-0) src/imports/ContactView/ContactView.qml (+2/-1) src/imports/Ubuntu/Contacts/CMakeLists.txt (+1/-0) src/imports/Ubuntu/Contacts/ContactFetch.qml (+32/-5) src/imports/Ubuntu/Contacts/ContactListView.qml (+1/-0) src/imports/Ubuntu/Contacts/ContactSearchListView.qml (+7/-0) src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+17/-16) src/imports/Ubuntu/Contacts/qmldir (+1/-0) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/dynamic-backend |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Gustavo Pichorim Boiko (community) | Approve | ||
Review via email: mp+192326@code.launchpad.net |
Commit message
Allow change the application QtContact backend, using env variable (QTCONTACTS_
Description of the change
Gustavo Pichorim Boiko (boiko) wrote : | # |
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
> 57 + // use galare as default QtContacts Manager
> 58 + if (qEnvironmentVa
> 59 + defaultManager = qgetenv(
> 60 + }
>
> Wouldn't it be a good idea to check if the value set from command line
> actually exists in the list of available managers?
If the manager does not exists it will use the default one.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:109
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:110
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Gustavo Pichorim Boiko (boiko) wrote : | # |
Looks good and works as expected!
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Francis Ginther (fginther) wrote : | # |
jenkins failed due to a bad armhf build node. Re-approving.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2013-10-08 18:42:21 +0000 | |||
3 | +++ CMakeLists.txt 2013-10-23 13:28:45 +0000 | |||
4 | @@ -27,18 +27,6 @@ | |||
5 | 27 | # Tests | 27 | # Tests |
6 | 28 | enable_testing() | 28 | enable_testing() |
7 | 29 | 29 | ||
8 | 30 | # uninstall target | ||
9 | 31 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" | ||
10 | 32 | "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
11 | 33 | IMMEDIATE @ONLY) | ||
12 | 34 | add_custom_target(uninstall "${CMAKE_COMMAND}" | ||
13 | 35 | -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") | ||
14 | 36 | |||
15 | 37 | # config file | ||
16 | 38 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" | ||
17 | 39 | "${CMAKE_CURRENT_BINARY_DIR}/config.h" | ||
18 | 40 | IMMEDIATE @ONLY) | ||
19 | 41 | |||
20 | 42 | # components PATH | 30 | # components PATH |
21 | 43 | execute_process( | 31 | execute_process( |
22 | 44 | COMMAND qmake -query QT_INSTALL_QML | 32 | COMMAND qmake -query QT_INSTALL_QML |
23 | @@ -51,3 +39,15 @@ | |||
24 | 51 | add_subdirectory(src) | 39 | add_subdirectory(src) |
25 | 52 | add_subdirectory(po) | 40 | add_subdirectory(po) |
26 | 53 | add_subdirectory(tests) | 41 | add_subdirectory(tests) |
27 | 42 | |||
28 | 43 | # uninstall target | ||
29 | 44 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" | ||
30 | 45 | "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
31 | 46 | IMMEDIATE @ONLY) | ||
32 | 47 | add_custom_target(uninstall "${CMAKE_COMMAND}" | ||
33 | 48 | -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") | ||
34 | 49 | |||
35 | 50 | # config file | ||
36 | 51 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" | ||
37 | 52 | "${CMAKE_CURRENT_BINARY_DIR}/config.h" | ||
38 | 53 | IMMEDIATE @ONLY) | ||
39 | 54 | 54 | ||
40 | === modified file 'src/app/addressbookapp.cpp' | |||
41 | --- src/app/addressbookapp.cpp 2013-10-15 14:34:03 +0000 | |||
42 | +++ src/app/addressbookapp.cpp 2013-10-23 13:28:45 +0000 | |||
43 | @@ -18,6 +18,7 @@ | |||
44 | 18 | #include "addressbookapp.h" | 18 | #include "addressbookapp.h" |
45 | 19 | #include "imagescalethread.h" | 19 | #include "imagescalethread.h" |
46 | 20 | 20 | ||
47 | 21 | |||
48 | 21 | #include <QDir> | 22 | #include <QDir> |
49 | 22 | #include <QUrl> | 23 | #include <QUrl> |
50 | 23 | #include <QUrlQuery> | 24 | #include <QUrlQuery> |
51 | @@ -90,6 +91,13 @@ | |||
52 | 90 | 91 | ||
53 | 91 | QString contactKey; | 92 | QString contactKey; |
54 | 92 | QStringList arguments = this->arguments(); | 93 | QStringList arguments = this->arguments(); |
55 | 94 | QByteArray defaultManager("galera"); | ||
56 | 95 | |||
57 | 96 | // use galare as default QtContacts Manager | ||
58 | 97 | if (qEnvironmentVariableIsSet("QTCONTACTS_MANAGER_OVERRIDE")) { | ||
59 | 98 | defaultManager = qgetenv("QTCONTACTS_MANAGER_OVERRIDE"); | ||
60 | 99 | } | ||
61 | 100 | qDebug() << "Using contact manager:" << defaultManager; | ||
62 | 93 | 101 | ||
63 | 94 | if (arguments.contains("--help")) { | 102 | if (arguments.contains("--help")) { |
64 | 95 | printUsage(arguments); | 103 | printUsage(arguments); |
65 | @@ -147,6 +155,7 @@ | |||
66 | 147 | m_view->setResizeMode(QQuickView::SizeRootObjectToView); | 155 | m_view->setResizeMode(QQuickView::SizeRootObjectToView); |
67 | 148 | m_view->setTitle("AddressBook"); | 156 | m_view->setTitle("AddressBook"); |
68 | 149 | m_view->engine()->addImportPath(importPath("/imports/")); | 157 | m_view->engine()->addImportPath(importPath("/imports/")); |
69 | 158 | m_view->rootContext()->setContextProperty("DEFAULT_CONTACT_MANAGER", defaultManager); | ||
70 | 150 | m_view->rootContext()->setContextProperty("application", this); | 159 | m_view->rootContext()->setContextProperty("application", this); |
71 | 151 | m_view->rootContext()->setContextProperty("contactKey", contactKey); | 160 | m_view->rootContext()->setContextProperty("contactKey", contactKey); |
72 | 152 | 161 | ||
73 | 153 | 162 | ||
74 | === modified file 'src/imports/Common/ContactDetailGroupBase.qml' | |||
75 | --- src/imports/Common/ContactDetailGroupBase.qml 2013-10-03 22:48:16 +0000 | |||
76 | +++ src/imports/Common/ContactDetailGroupBase.qml 2013-10-23 13:28:45 +0000 | |||
77 | @@ -33,10 +33,11 @@ | |||
78 | 33 | property Component detailDelegate | 33 | property Component detailDelegate |
79 | 34 | property int minimumHeight: 0 | 34 | property int minimumHeight: 0 |
80 | 35 | property bool loaded: false | 35 | property bool loaded: false |
81 | 36 | property bool showEmpty: true | ||
82 | 36 | 37 | ||
83 | 37 | signal newFieldAdded(var index) | 38 | signal newFieldAdded(var index) |
84 | 38 | 39 | ||
86 | 39 | implicitHeight: root.details.length > 0 ? contents.implicitHeight : minimumHeight | 40 | implicitHeight: detailsModel.values.length > 0 ? contents.implicitHeight : minimumHeight |
87 | 40 | visible: implicitHeight > 0 | 41 | visible: implicitHeight > 0 |
88 | 41 | 42 | ||
89 | 42 | // This model is used to avoid rebuild the repeater every time that the details change | 43 | // This model is used to avoid rebuild the repeater every time that the details change |
90 | @@ -44,7 +45,25 @@ | |||
91 | 44 | ListModel { | 45 | ListModel { |
92 | 45 | id: detailsModel | 46 | id: detailsModel |
93 | 46 | 47 | ||
95 | 47 | property var values: root.details | 48 | property var values: root.showEmpty ? root.details : filterDetails(root.details) |
96 | 49 | |||
97 | 50 | function filterDetails(details) { | ||
98 | 51 | var result = [] | ||
99 | 52 | for(var d in details) { | ||
100 | 53 | var isEmpty = true | ||
101 | 54 | for(var f in root.fields) { | ||
102 | 55 | var fieldValue = details[d].value(root.fields[f]) | ||
103 | 56 | if (fieldValue && (String(fieldValue) !== "")) { | ||
104 | 57 | isEmpty = false | ||
105 | 58 | break; | ||
106 | 59 | } | ||
107 | 60 | } | ||
108 | 61 | if (!isEmpty) { | ||
109 | 62 | result.push(details[d]) | ||
110 | 63 | } | ||
111 | 64 | } | ||
112 | 65 | return result | ||
113 | 66 | } | ||
114 | 48 | 67 | ||
115 | 49 | onValuesChanged: { | 68 | onValuesChanged: { |
116 | 50 | if (!values) { | 69 | if (!values) { |
117 | 51 | 70 | ||
118 | === modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml' | |||
119 | --- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-10-03 22:48:16 +0000 | |||
120 | +++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-10-23 13:28:45 +0000 | |||
121 | @@ -45,10 +45,12 @@ | |||
122 | 45 | var input = fieldValues.children[i] | 45 | var input = fieldValues.children[i] |
123 | 46 | if (input.detail && (input.field >= 0)) { | 46 | if (input.detail && (input.field >= 0)) { |
124 | 47 | var originalValue = input.detail.value(input.field) | 47 | var originalValue = input.detail.value(input.field) |
126 | 48 | if (input.text != "") { | 48 | originalValue = originalValue ? String(originalValue) : "" |
127 | 49 | if (input.text !== "") { | ||
128 | 49 | isEmpty = false | 50 | isEmpty = false |
129 | 50 | } | 51 | } |
131 | 51 | if (originalValue != input.text) { | 52 | |
132 | 53 | if (originalValue !== input.text) { | ||
133 | 52 | input.detail.setValue(input.field, input.text) | 54 | input.detail.setValue(input.field, input.text) |
134 | 53 | detailchanged = true | 55 | detailchanged = true |
135 | 54 | } | 56 | } |
136 | 55 | 57 | ||
137 | === modified file 'src/imports/ContactList/ContactListPage.qml' | |||
138 | --- src/imports/ContactList/ContactListPage.qml 2013-10-10 15:15:15 +0000 | |||
139 | +++ src/imports/ContactList/ContactListPage.qml 2013-10-23 13:28:45 +0000 | |||
140 | @@ -65,6 +65,7 @@ | |||
141 | 65 | ContactsUI.ContactListView { | 65 | ContactsUI.ContactListView { |
142 | 66 | id: contactList | 66 | id: contactList |
143 | 67 | 67 | ||
144 | 68 | manager: DEFAULT_CONTACT_MANAGER | ||
145 | 68 | showFavoritePhoneLabel: false | 69 | showFavoritePhoneLabel: false |
146 | 69 | multiSelectionEnabled: true | 70 | multiSelectionEnabled: true |
147 | 70 | anchors { | 71 | anchors { |
148 | 71 | 72 | ||
149 | === modified file 'src/imports/ContactView/CMakeLists.txt' | |||
150 | --- src/imports/ContactView/CMakeLists.txt 2013-09-17 01:31:27 +0000 | |||
151 | +++ src/imports/ContactView/CMakeLists.txt 2013-10-23 13:28:45 +0000 | |||
152 | @@ -12,7 +12,6 @@ | |||
153 | 12 | ContactDetailPhoneNumbersView.qml | 12 | ContactDetailPhoneNumbersView.qml |
154 | 13 | ContactDetailPhoneNumberView.qml | 13 | ContactDetailPhoneNumberView.qml |
155 | 14 | ContactDetailWithTypeView.qml | 14 | ContactDetailWithTypeView.qml |
156 | 15 | ContactFetch.qml | ||
157 | 16 | ContactHeaderView.qml | 15 | ContactHeaderView.qml |
158 | 17 | ContactView.qml | 16 | ContactView.qml |
159 | 18 | ) | 17 | ) |
160 | 19 | 18 | ||
161 | === modified file 'src/imports/ContactView/ContactDetailGroupWithTypeView.qml' | |||
162 | --- src/imports/ContactView/ContactDetailGroupWithTypeView.qml 2013-07-25 20:00:03 +0000 | |||
163 | +++ src/imports/ContactView/ContactDetailGroupWithTypeView.qml 2013-10-23 13:28:45 +0000 | |||
164 | @@ -27,6 +27,7 @@ | |||
165 | 27 | property Action defaultAction | 27 | property Action defaultAction |
166 | 28 | signal actionTrigerred(string action, QtObject detail) | 28 | signal actionTrigerred(string action, QtObject detail) |
167 | 29 | 29 | ||
168 | 30 | showEmpty: false | ||
169 | 30 | headerDelegate: ListItem.Empty { | 31 | headerDelegate: ListItem.Empty { |
170 | 31 | highlightWhenPressed: false | 32 | highlightWhenPressed: false |
171 | 32 | 33 | ||
172 | 33 | 34 | ||
173 | === modified file 'src/imports/ContactView/ContactView.qml' | |||
174 | --- src/imports/ContactView/ContactView.qml 2013-09-19 12:37:39 +0000 | |||
175 | +++ src/imports/ContactView/ContactView.qml 2013-10-23 13:28:45 +0000 | |||
176 | @@ -18,6 +18,7 @@ | |||
177 | 18 | import QtContacts 5.0 | 18 | import QtContacts 5.0 |
178 | 19 | import Ubuntu.Components 0.1 | 19 | import Ubuntu.Components 0.1 |
179 | 20 | import Ubuntu.Components.ListItems 0.1 as ListItem | 20 | import Ubuntu.Components.ListItems 0.1 as ListItem |
180 | 21 | import Ubuntu.Contacts 0.1 as ContactsUI | ||
181 | 21 | 22 | ||
182 | 22 | Page { | 23 | Page { |
183 | 23 | id: root | 24 | id: root |
184 | @@ -137,7 +138,7 @@ | |||
185 | 137 | anchors.centerIn: parent | 138 | anchors.centerIn: parent |
186 | 138 | } | 139 | } |
187 | 139 | 140 | ||
189 | 140 | ContactFetch { | 141 | ContactsUI.ContactFetch { |
190 | 141 | id: contactFetch | 142 | id: contactFetch |
191 | 142 | 143 | ||
192 | 143 | onContactRemoved: pageStack.pop() | 144 | onContactRemoved: pageStack.pop() |
193 | 144 | 145 | ||
194 | === modified file 'src/imports/Ubuntu/Contacts/CMakeLists.txt' | |||
195 | --- src/imports/Ubuntu/Contacts/CMakeLists.txt 2013-10-08 20:53:44 +0000 | |||
196 | +++ src/imports/Ubuntu/Contacts/CMakeLists.txt 2013-10-23 13:28:45 +0000 | |||
197 | @@ -5,6 +5,7 @@ | |||
198 | 5 | ContactDetailPhoneNumberTypeModel.qml | 5 | ContactDetailPhoneNumberTypeModel.qml |
199 | 6 | ContactDetailPickerDelegate.qml | 6 | ContactDetailPickerDelegate.qml |
200 | 7 | ContactDetailPickerPhoneNumberDelegate.qml | 7 | ContactDetailPickerPhoneNumberDelegate.qml |
201 | 8 | ContactFetch.qml | ||
202 | 8 | ContactListView.qml | 9 | ContactListView.qml |
203 | 9 | Contacts.js | 10 | Contacts.js |
204 | 10 | ContactSearchListView.qml | 11 | ContactSearchListView.qml |
205 | 11 | 12 | ||
206 | === renamed file 'src/imports/ContactView/ContactFetch.qml' => 'src/imports/Ubuntu/Contacts/ContactFetch.qml' | |||
207 | --- src/imports/ContactView/ContactFetch.qml 2013-09-11 22:39:52 +0000 | |||
208 | +++ src/imports/Ubuntu/Contacts/ContactFetch.qml 2013-10-23 13:28:45 +0000 | |||
209 | @@ -24,17 +24,35 @@ | |||
210 | 24 | property QtObject contact: null | 24 | property QtObject contact: null |
211 | 25 | property bool contactIsDirty: false | 25 | property bool contactIsDirty: false |
212 | 26 | 26 | ||
213 | 27 | property string _pendingId: "" | ||
214 | 28 | property bool _ready: false | ||
215 | 29 | |||
216 | 27 | signal contactFetched(QtObject contact) | 30 | signal contactFetched(QtObject contact) |
217 | 28 | signal contactRemoved() | 31 | signal contactRemoved() |
218 | 29 | 32 | ||
219 | 30 | function fetchContact(contactId) { | 33 | function fetchContact(contactId) { |
220 | 34 | if (root._ready) { | ||
221 | 35 | root._fetchContact(contactId) | ||
222 | 36 | } else { | ||
223 | 37 | root._pendingId = contactId | ||
224 | 38 | } | ||
225 | 39 | } | ||
226 | 40 | |||
227 | 41 | function _fetchContact(contactId) { | ||
228 | 31 | if (contact && !contactIsDirty) { | 42 | if (contact && !contactIsDirty) { |
229 | 32 | contactFetched(contact) | 43 | contactFetched(contact) |
230 | 33 | } else { | 44 | } else { |
231 | 34 | running = true | 45 | running = true |
235 | 35 | connections.currentQueryId = model.fetchContacts([contactId]) | 46 | if (model.manager === "memory") { |
236 | 36 | if (connections.currentQueryId === -1) { | 47 | // memory backend emit contact fetched before return from "fetchContacts" we will use operation = "-2" |
237 | 37 | running = false | 48 | // to say that we are wainting for a operation from memory manager |
238 | 49 | connections.currentQueryId = -2 | ||
239 | 50 | model.fetchContacts([contactId]) | ||
240 | 51 | } else { | ||
241 | 52 | connections.currentQueryId = model.fetchContacts([contactId]) | ||
242 | 53 | if (connections.currentQueryId === -1) { | ||
243 | 54 | running = false | ||
244 | 55 | } | ||
245 | 38 | } | 56 | } |
246 | 39 | } | 57 | } |
247 | 40 | } | 58 | } |
248 | @@ -62,13 +80,22 @@ | |||
249 | 62 | property int currentQueryId: -1 | 80 | property int currentQueryId: -1 |
250 | 63 | 81 | ||
251 | 64 | onContactsFetched: { | 82 | onContactsFetched: { |
253 | 65 | if (requestId == currentQueryId) { | 83 | // currentQueryId == -2 is used during a fetch using "memory" manager |
254 | 84 | if ((currentQueryId == -2) || (requestId == currentQueryId)) { | ||
255 | 66 | root.contactIsDirty = false | 85 | root.contactIsDirty = false |
256 | 67 | root.running = false | 86 | root.running = false |
257 | 68 | currentQueryId = -1 | 87 | currentQueryId = -1 |
258 | 88 | root.contact = fetchedContacts[0] | ||
259 | 69 | root.contactFetched(fetchedContacts[0]) | 89 | root.contactFetched(fetchedContacts[0]) |
260 | 70 | root.contact = fetchedContacts[0] | ||
261 | 71 | } | 90 | } |
262 | 72 | } | 91 | } |
263 | 73 | } | 92 | } |
264 | 93 | |||
265 | 94 | Component.onCompleted: { | ||
266 | 95 | root._ready = true | ||
267 | 96 | if (root._pendingId != "") { | ||
268 | 97 | root._fetchContact(root._pendingId) | ||
269 | 98 | root._pendingId = "" | ||
270 | 99 | } | ||
271 | 100 | } | ||
272 | 74 | } | 101 | } |
273 | 75 | 102 | ||
274 | === modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml' | |||
275 | --- src/imports/Ubuntu/Contacts/ContactListView.qml 2013-10-10 15:15:15 +0000 | |||
276 | +++ src/imports/Ubuntu/Contacts/ContactListView.qml 2013-10-23 13:28:45 +0000 | |||
277 | @@ -56,6 +56,7 @@ | |||
278 | 56 | ContactSimpleListView { | 56 | ContactSimpleListView { |
279 | 57 | id: favouritesList | 57 | id: favouritesList |
280 | 58 | 58 | ||
281 | 59 | manager: root.manager | ||
282 | 59 | header: ListItem.Header { | 60 | header: ListItem.Header { |
283 | 60 | height: units.gu(5) | 61 | height: units.gu(5) |
284 | 61 | text: i18n.tr("Favourites") | 62 | text: i18n.tr("Favourites") |
285 | 62 | 63 | ||
286 | === modified file 'src/imports/Ubuntu/Contacts/ContactSearchListView.qml' | |||
287 | --- src/imports/Ubuntu/Contacts/ContactSearchListView.qml 2013-09-26 14:39:08 +0000 | |||
288 | +++ src/imports/Ubuntu/Contacts/ContactSearchListView.qml 2013-10-23 13:28:45 +0000 | |||
289 | @@ -111,6 +111,13 @@ | |||
290 | 111 | */ | 111 | */ |
291 | 112 | property variant detailFieldsToDisplay: [ PhoneNumber.Number ] | 112 | property variant detailFieldsToDisplay: [ PhoneNumber.Number ] |
292 | 113 | /*! | 113 | /*! |
293 | 114 | \qmlproperty string manager | ||
294 | 115 | |||
295 | 116 | This property holds the manager uri of the contact backend engine. | ||
296 | 117 | By default this is set to "galera" | ||
297 | 118 | */ | ||
298 | 119 | property alias manager: contactsModel.manager | ||
299 | 120 | /*! | ||
300 | 114 | \internal \qmlproperty variant ___selectedDetail | 121 | \internal \qmlproperty variant ___selectedDetail |
301 | 115 | */ | 122 | */ |
302 | 116 | property variant ___selectedDetail: null | 123 | property variant ___selectedDetail: null |
303 | 117 | 124 | ||
304 | === modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml' | |||
305 | --- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-10-15 18:34:42 +0000 | |||
306 | +++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-10-23 13:28:45 +0000 | |||
307 | @@ -149,6 +149,15 @@ | |||
308 | 149 | By default this is set to true | 149 | By default this is set to true |
309 | 150 | */ | 150 | */ |
310 | 151 | property bool showSections: true | 151 | property bool showSections: true |
311 | 152 | |||
312 | 153 | /*! | ||
313 | 154 | \qmlproperty string manager | ||
314 | 155 | |||
315 | 156 | This property holds the manager uri of the contact backend engine. | ||
316 | 157 | By default this is set to "galera" | ||
317 | 158 | */ | ||
318 | 159 | property alias manager: contactsModel.manager | ||
319 | 160 | |||
320 | 152 | /*! | 161 | /*! |
321 | 153 | This handler is called when any error occurs in the contact model | 162 | This handler is called when any error occurs in the contact model |
322 | 154 | */ | 163 | */ |
323 | @@ -200,11 +209,8 @@ | |||
324 | 200 | */ | 209 | */ |
325 | 201 | function _fetchContact(index, contact) | 210 | function _fetchContact(index, contact) |
326 | 202 | { | 211 | { |
327 | 203 | if (priv.currentOperation !== -1) { | ||
328 | 204 | return | ||
329 | 205 | } | ||
330 | 206 | contactListView.currentIndex = index | 212 | contactListView.currentIndex = index |
332 | 207 | priv.currentOperation = contactsModel.fetchContacts(contact.contactId) | 213 | contactFetch.fetchContact(contact.contactId) |
333 | 208 | } | 214 | } |
334 | 209 | 215 | ||
335 | 210 | clip: true | 216 | clip: true |
336 | @@ -259,7 +265,7 @@ | |||
337 | 259 | width: parent.width | 265 | width: parent.width |
338 | 260 | visible: loaderDelegate.status == Loader.Ready | 266 | visible: loaderDelegate.status == Loader.Ready |
339 | 261 | state: contactListView.expanded ? "" : "collapsed" | 267 | state: contactListView.expanded ? "" : "collapsed" |
341 | 262 | 268 | ||
342 | 263 | Behavior on height { | 269 | Behavior on height { |
343 | 264 | enabled: currentContactExpanded == index || detailsShown | 270 | enabled: currentContactExpanded == index || detailsShown |
344 | 265 | UbuntuNumberAnimation {} | 271 | UbuntuNumberAnimation {} |
345 | @@ -349,6 +355,7 @@ | |||
346 | 349 | return | 355 | return |
347 | 350 | } | 356 | } |
348 | 351 | 357 | ||
349 | 358 | console.debug("Will fetch" + contact) | ||
350 | 352 | contactListView._fetchContact(index, contact) | 359 | contactListView._fetchContact(index, contact) |
351 | 353 | } | 360 | } |
352 | 354 | onPressAndHold: { | 361 | onPressAndHold: { |
353 | @@ -463,17 +470,11 @@ | |||
354 | 463 | onTriggered: priv.scrollList() | 470 | onTriggered: priv.scrollList() |
355 | 464 | } | 471 | } |
356 | 465 | 472 | ||
368 | 466 | Connections { | 473 | ContactFetch { |
369 | 467 | target: listModel | 474 | id: contactFetch |
370 | 468 | onContactsFetched: { | 475 | |
371 | 469 | if (requestId == priv.currentOperation) { | 476 | model: contactsModel |
372 | 470 | priv.currentOperation = -1 | 477 | onContactFetched: contactListView.contactClicked(contact) |
362 | 471 | // this fetch request can only return one contact | ||
363 | 472 | if(fetchedContacts.length !== 1) | ||
364 | 473 | return | ||
365 | 474 | contactListView.contactClicked(fetchedContacts[0]) | ||
366 | 475 | } | ||
367 | 476 | } | ||
373 | 477 | } | 478 | } |
374 | 478 | 479 | ||
375 | 479 | // This is a workaround to make sure the spinner will disappear if the model is empty | 480 | // This is a workaround to make sure the spinner will disappear if the model is empty |
376 | 480 | 481 | ||
377 | === modified file 'src/imports/Ubuntu/Contacts/qmldir' | |||
378 | --- src/imports/Ubuntu/Contacts/qmldir 2013-10-04 19:16:48 +0000 | |||
379 | +++ src/imports/Ubuntu/Contacts/qmldir 2013-10-23 13:28:45 +0000 | |||
380 | @@ -2,6 +2,7 @@ | |||
381 | 2 | 2 | ||
382 | 3 | ContactDetailOnlineAccountTypeModel 0.1 ContactDetailOnlineAccountTypeModel.qml | 3 | ContactDetailOnlineAccountTypeModel 0.1 ContactDetailOnlineAccountTypeModel.qml |
383 | 4 | ContactDetailPhoneNumberTypeModel 0.1 ContactDetailPhoneNumberTypeModel.qml | 4 | ContactDetailPhoneNumberTypeModel 0.1 ContactDetailPhoneNumberTypeModel.qml |
384 | 5 | ContactFetch 0.1 ContactFetch.qml | ||
385 | 5 | ContactListView 0.1 ContactListView.qml | 6 | ContactListView 0.1 ContactListView.qml |
386 | 6 | ContactSearchListView 0.1 ContactSearchListView.qml | 7 | ContactSearchListView 0.1 ContactSearchListView.qml |
387 | 7 | ContactSimpleListView 0.1 ContactSimpleListView.qml | 8 | ContactSimpleListView 0.1 ContactSimpleListView.qml |
57 + // use galare as default QtContacts Manager riableIsSet( "QTCONTACTS_ MANAGER_ OVERRIDE" )) { "QTCONTACTS_ MANAGER_ OVERRIDE" );
58 + if (qEnvironmentVa
59 + defaultManager = qgetenv(
60 + }
Wouldn't it be a good idea to check if the value set from command line actually exists in the list of available managers?