Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-merged-trunk-revno-181 into lp:ubuntu-docviewer-app
- reboot-merged-trunk-revno-181
- Merge into lo-viewer
Proposed by
Stefano Verzegnassi
Status: | Merged |
---|---|
Approved by: | Stefano Verzegnassi |
Approved revision: | 170 |
Merged at revision: | 171 |
Proposed branch: | lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-merged-trunk-revno-181 |
Merge into: | lp:ubuntu-docviewer-app |
Diff against target: |
1007 lines (+540/-286) 13 files modified
AUTHORS (+26/-0) src/app/qml/common/ToastWithAction.qml (+2/-2) src/app/qml/documentPage/DeleteFileDialog.qml (+12/-2) src/app/qml/documentPage/DocumentDelegateActions.qml (+41/-0) src/app/qml/documentPage/DocumentGridDelegate.qml (+65/-169) src/app/qml/documentPage/DocumentListDelegate.qml (+12/-19) src/app/qml/documentPage/SortSettingsDialog.qml (+1/-1) src/app/qml/documentPage/TileBase.qml (+369/-0) src/plugin/file-qml-plugin/documentmodel.cpp (+0/-6) src/plugin/poppler-qml-plugin/CMakeLists.txt (+1/-2) src/plugin/poppler-qml-plugin/pdfdocument.cpp (+11/-8) src/plugin/poppler-qml-plugin/pdfthread.cpp (+0/-35) src/plugin/poppler-qml-plugin/pdfthread.h (+0/-42) |
To merge this branch: | bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-merged-trunk-revno-181 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Roman Shchekin | Approve | ||
Review via email: mp+266904@code.launchpad.net |
Commit message
Merged trunk (rev. 181) into "reboot" branch
Description of the change
Merged trunk (rev. 181) into "reboot" branch
To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
review:
Needs Fixing
(continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) : | # |
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'AUTHORS' | |||
2 | --- AUTHORS 1970-01-01 00:00:00 +0000 | |||
3 | +++ AUTHORS 2015-08-04 16:03:21 +0000 | |||
4 | @@ -0,0 +1,26 @@ | |||
5 | 1 | DocViewer was started in 2013 and has received many contributions from the following people. | ||
6 | 2 | |||
7 | 3 | In addition, numerous translations, bug reports and other non-code contributions have been made which are equally valued. | ||
8 | 4 | |||
9 | 5 | Adolfo Jayme Barrientos <fitojb@ubuntu.com> | ||
10 | 6 | Akiva Abraham <akiva@linux.com> | ||
11 | 7 | Alan Pope <alan.pope@canonical.com> | ||
12 | 8 | Andrew Hayzen <ahayzen@gmail.com> | ||
13 | 9 | Arto Jalkanen <ajalkane@gmail.com> | ||
14 | 10 | Bartosz Kosiorek <gang65@poczta.onet.pl> | ||
15 | 11 | Carla Sella <carla.sella@gmail.com> | ||
16 | 12 | Daniel Holbach <daniel.holbach@canonical.com> | ||
17 | 13 | David Planella <david.planella@ubuntu.com> | ||
18 | 14 | Didier Roche <didrocks@ubuntu.com> | ||
19 | 15 | Fabio Colella <fcole90@gmail.com> | ||
20 | 16 | Francis Ginther <francis.ginther@canonical.com> | ||
21 | 17 | Granger Anthony <grangeranthony@gmail.com> | ||
22 | 18 | Michael Hall <mhall119@ubuntu.com> | ||
23 | 19 | Nicholas Skaggs <nicholas.skaggs@canonical.com> | ||
24 | 20 | Olivier Tilloy <olivier.tilloy@canonical.com> | ||
25 | 21 | Omer Akram <om26er@ubuntu.com> | ||
26 | 22 | Richard Somlói <level@somloirichard.hu> | ||
27 | 23 | Roman Shchekin <mrqtros@gmail.com> | ||
28 | 24 | Sergio Schvezov <sergio.schvezov@canonical.com> | ||
29 | 25 | Stefano Verzegnassi <stefano92.100@gmail.com> | ||
30 | 26 | xeranas <anorkus@fastmail.fm> | ||
31 | 0 | 27 | ||
32 | === modified file 'src/app/qml/common/ToastWithAction.qml' | |||
33 | --- src/app/qml/common/ToastWithAction.qml 2015-04-07 22:52:48 +0000 | |||
34 | +++ src/app/qml/common/ToastWithAction.qml 2015-08-04 16:03:21 +0000 | |||
35 | @@ -60,8 +60,8 @@ | |||
36 | 60 | } | 60 | } |
37 | 61 | 61 | ||
38 | 62 | AbstractButton { | 62 | AbstractButton { |
41 | 63 | width: actionLabel.paintedWidth | 63 | Layout.preferredWidth: actionLabel.paintedWidth |
42 | 64 | height: parent.height | 64 | Layout.fillHeight: true |
43 | 65 | 65 | ||
44 | 66 | onClicked: { | 66 | onClicked: { |
45 | 67 | action.triggered("[Toast] Action %1 clicked!".arg(action.text)) | 67 | action.triggered("[Toast] Action %1 clicked!".arg(action.text)) |
46 | 68 | 68 | ||
47 | === modified file 'src/app/qml/documentPage/DeleteFileDialog.qml' | |||
48 | --- src/app/qml/documentPage/DeleteFileDialog.qml 2015-04-29 15:23:32 +0000 | |||
49 | +++ src/app/qml/documentPage/DeleteFileDialog.qml 2015-08-04 16:03:21 +0000 | |||
50 | @@ -25,6 +25,14 @@ | |||
51 | 25 | property string path | 25 | property string path |
52 | 26 | property int __deleteCount: documentPage.view.item.selectedItems.count | 26 | property int __deleteCount: documentPage.view.item.selectedItems.count |
53 | 27 | 27 | ||
54 | 28 | // WORKAROUND: This property is used only when user wants to remove a single | ||
55 | 29 | // file from a delegate action, and the value of the property is read during | ||
56 | 30 | // the Component.onDestruction event. | ||
57 | 31 | // We do this because we need to avoid that the entry in the model is removed | ||
58 | 32 | // before this dialog is closed. | ||
59 | 33 | // See src/app/qml/documentPage/DocumentDelegateActions.qml | ||
60 | 34 | property bool confirmed: false | ||
61 | 35 | |||
62 | 28 | title: path ? i18n.tr("Delete file") : | 36 | title: path ? i18n.tr("Delete file") : |
63 | 29 | i18n.tr("Delete %1 file", "Delete %1 files", __deleteCount).arg(__deleteCount) | 37 | i18n.tr("Delete %1 file", "Delete %1 files", __deleteCount).arg(__deleteCount) |
64 | 30 | text: path ? i18n.tr("Are you sure you want to permanently delete this file?") : | 38 | text: path ? i18n.tr("Are you sure you want to permanently delete this file?") : |
65 | @@ -43,17 +51,19 @@ | |||
66 | 43 | 51 | ||
67 | 44 | onClicked: { | 52 | onClicked: { |
68 | 45 | if (deleteFileDialog.path) { | 53 | if (deleteFileDialog.path) { |
70 | 46 | docModel.rm(path) | 54 | deleteFileDialog.confirmed = true; |
71 | 47 | } else { | 55 | } else { |
72 | 56 | // This is called from selection mode | ||
73 | 48 | var items = documentPage.view.item.selectedItems; | 57 | var items = documentPage.view.item.selectedItems; |
74 | 49 | 58 | ||
75 | 50 | for (var i=0; i < items.count; i++) { | 59 | for (var i=0; i < items.count; i++) { |
76 | 51 | console.log("Removing:", items.get(i).model.path); | 60 | console.log("Removing:", items.get(i).model.path); |
77 | 52 | docModel.rm(items.get(i).model.path); | 61 | docModel.rm(items.get(i).model.path); |
78 | 53 | } | 62 | } |
79 | 63 | |||
80 | 64 | viewLoader.item.endSelection(); | ||
81 | 54 | } | 65 | } |
82 | 55 | 66 | ||
83 | 56 | viewLoader.item.endSelection(); | ||
84 | 57 | PopupUtils.close(deleteFileDialog) | 67 | PopupUtils.close(deleteFileDialog) |
85 | 58 | } | 68 | } |
86 | 59 | } | 69 | } |
87 | 60 | 70 | ||
88 | === added file 'src/app/qml/documentPage/DocumentDelegateActions.qml' | |||
89 | --- src/app/qml/documentPage/DocumentDelegateActions.qml 1970-01-01 00:00:00 +0000 | |||
90 | +++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-08-04 16:03:21 +0000 | |||
91 | @@ -0,0 +1,41 @@ | |||
92 | 1 | /* | ||
93 | 2 | Copyright (C) 2015 Canonical Ltd. | ||
94 | 3 | |||
95 | 4 | This program is free software: you can redistribute it and/or modify | ||
96 | 5 | it under the terms of the GNU General Public License 3 as published by | ||
97 | 6 | the Free Software Foundation. | ||
98 | 7 | |||
99 | 8 | This program is distributed in the hope that it will be useful, | ||
100 | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
101 | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
102 | 11 | GNU General Public License for more details. | ||
103 | 12 | |||
104 | 13 | You should have received a copy of the GNU General Public License | ||
105 | 14 | along with this program. If not, see http://www.gnu.org/licenses/. | ||
106 | 15 | */ | ||
107 | 16 | |||
108 | 17 | import QtQuick 2.0 | ||
109 | 18 | import Ubuntu.Components 1.1 | ||
110 | 19 | import Ubuntu.Components.Popups 1.0 | ||
111 | 20 | |||
112 | 21 | QtObject { | ||
113 | 22 | property list<Action> leadingActions: [ | ||
114 | 23 | Action { | ||
115 | 24 | iconName: "delete" | ||
116 | 25 | text: i18n.tr("Delete") | ||
117 | 26 | onTriggered: { | ||
118 | 27 | var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), | ||
119 | 28 | documentPage, { path: model.path }) | ||
120 | 29 | |||
121 | 30 | dialog.Component.destruction.connect(function() { | ||
122 | 31 | if (dialog.confirmed) { | ||
123 | 32 | console.log("Removing:", model.path); | ||
124 | 33 | docModel.rm(model.path); | ||
125 | 34 | } | ||
126 | 35 | }); | ||
127 | 36 | } | ||
128 | 37 | } | ||
129 | 38 | ] | ||
130 | 39 | |||
131 | 40 | property list<Action> trailingActions | ||
132 | 41 | } | ||
133 | 0 | 42 | ||
134 | === modified file 'src/app/qml/documentPage/DocumentGridDelegate.qml' | |||
135 | --- src/app/qml/documentPage/DocumentGridDelegate.qml 2015-07-14 01:35:59 +0000 | |||
136 | +++ src/app/qml/documentPage/DocumentGridDelegate.qml 2015-08-04 16:03:21 +0000 | |||
137 | @@ -16,14 +16,11 @@ | |||
138 | 16 | 16 | ||
139 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
140 | 18 | import Ubuntu.Components 1.1 | 18 | import Ubuntu.Components 1.1 |
141 | 19 | import QtQuick.Layouts 1.1 | ||
142 | 20 | 19 | ||
143 | 21 | import "../common/utils.js" as Utils | 20 | import "../common/utils.js" as Utils |
144 | 22 | 21 | ||
146 | 23 | AbstractButton { | 22 | TileBase { |
147 | 24 | id: root | 23 | id: root |
148 | 25 | property bool selected: false | ||
149 | 26 | property bool selectionMode: false | ||
150 | 27 | 24 | ||
151 | 28 | function formattedDateTime() { | 25 | function formattedDateTime() { |
152 | 29 | var date = new Date(model.date) | 26 | var date = new Date(model.date) |
153 | @@ -49,169 +46,68 @@ | |||
154 | 49 | return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm")) | 46 | return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm")) |
155 | 50 | } | 47 | } |
156 | 51 | 48 | ||
322 | 52 | Rectangle { | 49 | title: model.name |
323 | 53 | anchors { fill: parent; margins: units.gu(0.5) } | 50 | text: formattedDateTime() |
324 | 54 | 51 | subText: Utils.printSize(i18n, model.size) | |
325 | 55 | color: Qt.lighter(UbuntuColors.lightGrey) | 52 | |
326 | 56 | clip: true | 53 | leadingActions: documentDelegateActions.leadingActions |
327 | 57 | 54 | trailingActions: documentDelegateActions.trailingActions | |
328 | 58 | Loader { | 55 | |
329 | 59 | id: selectionIcon | 56 | Icon { |
330 | 60 | 57 | id: extStorageIcon | |
331 | 61 | anchors { | 58 | |
332 | 62 | right: parent.right | 59 | width: units.gu(4) |
333 | 63 | top: parent.top | 60 | height: units.gu(4) |
334 | 64 | } | 61 | anchors { |
335 | 65 | 62 | left: parent.left | |
336 | 66 | z: 10 | 63 | top: parent.top |
337 | 67 | 64 | margins: units.gu(0.5) | |
338 | 68 | width: (status === Loader.Ready) ? item.implicitWidth : 0 | 65 | } |
339 | 69 | visible: (status === Loader.Ready) && (item.width === item.implicitWidth) | 66 | |
340 | 70 | Behavior on opacity { | 67 | visible: model.isFromExternalStorage |
341 | 71 | NumberAnimation { | 68 | source: Qt.resolvedUrl("../../graphics/sd-card-symbolic.png") |
342 | 72 | duration: UbuntuAnimation.SnapDuration | 69 | } |
343 | 73 | } | 70 | |
344 | 74 | } | 71 | // Document mimetype icon |
345 | 75 | } | 72 | Icon { |
346 | 76 | 73 | anchors.centerIn: parent | |
347 | 77 | Icon { | 74 | width: units.gu(8); height: width |
348 | 78 | id: extStorageIcon | 75 | |
349 | 79 | 76 | // At the moment the suru icon theme doesn't have much icons. | |
350 | 80 | width: units.gu(4) | 77 | // Just some note for the future: |
351 | 81 | height: units.gu(4) | 78 | // TODO: Add icons for Office/ODF documents |
352 | 82 | anchors { | 79 | // TODO: Whenever there will be icons for source code files, add them. |
353 | 83 | left: parent.left | 80 | name: { |
354 | 84 | top: parent.top | 81 | if (model.mimetype.substring(0, 5) === "text/") |
355 | 85 | margins: units.gu(0.5) | 82 | return "text-x-generic-symbolic" |
356 | 86 | } | 83 | |
357 | 87 | 84 | if (model.mimetype.substring(0, 5) === "image") | |
358 | 88 | visible: model.isFromExternalStorage | 85 | return "image-x-generic-symbolic" |
359 | 89 | source: Qt.resolvedUrl("../../graphics/sd-card-symbolic.png") | 86 | |
360 | 90 | } | 87 | if (model.mimetype === "application/pdf") |
361 | 91 | 88 | return "application-pdf-symbolic" | |
362 | 92 | // Document mimetype icon | 89 | |
363 | 93 | Icon { | 90 | return "package-x-generic-symbolic" |
364 | 94 | anchors.centerIn: parent | 91 | } |
365 | 95 | anchors.verticalCenterOffset: - infoColumn.height * 0.3 | 92 | } |
366 | 96 | 93 | ||
367 | 97 | width: units.gu(8); height: width | 94 | // Cover |
368 | 98 | 95 | /* Image { | |
369 | 99 | // At the moment the suru icon theme doesn't have much icons. | 96 | anchors.fill: parent |
370 | 100 | // Just some note for the future: | 97 | |
371 | 101 | // TODO: Add icons for Office/ODF documents | 98 | source: { |
372 | 102 | // TODO: Whenever there will be icons for source code files, add them. | 99 | if (model.cover !== "" && typeof model.cover !== "undefined") |
373 | 103 | name: { | 100 | return model.cover |
374 | 104 | if (model.mimetype.substring(0, 5) === "text/") | 101 | |
375 | 105 | return "text-x-generic-symbolic" | 102 | if (model.mimetype.toString().indexOf("image") !== -1) |
376 | 106 | 103 | return model.path | |
377 | 107 | if (model.mimetype.substring(0, 5) === "image") | 104 | |
378 | 108 | return "image-x-generic-symbolic" | 105 | return "" |
379 | 109 | 106 | } | |
380 | 110 | if (model.mimetype === "application/pdf") | 107 | |
381 | 111 | return "application-pdf-symbolic" | 108 | sourceSize.width: width |
382 | 112 | 109 | fillMode: Image.PreserveAspectCrop | |
383 | 113 | if (model.mimetype === "application/vnd.oasis.opendocument.text" | 110 | }*/ |
384 | 114 | || model.mimetype === "application/msword" | 111 | |
385 | 115 | || model.mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document") | 112 | DocumentDelegateActions { id: documentDelegateActions } |
221 | 116 | return "x-office-document-symbolic" | ||
222 | 117 | |||
223 | 118 | if (model.mimetype === "application/vnd.oasis.opendocument.spreadsheet" | ||
224 | 119 | || model.mimetype === "application/vnd.ms-excel" | ||
225 | 120 | || model.mimetype === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") | ||
226 | 121 | return "x-office-spreadsheet-symbolic" | ||
227 | 122 | |||
228 | 123 | if (model.mimetype === "application/vnd.oasis.opendocument.presentation" | ||
229 | 124 | || model.mimetype === "application/vnd.ms-powerpoint" | ||
230 | 125 | || model.mimetype === "application/vnd.openxmlformats-officedocument.presentationml.presentation") | ||
231 | 126 | return "x-office-presentation-symbolic" | ||
232 | 127 | |||
233 | 128 | return "package-x-generic-symbolic" | ||
234 | 129 | } | ||
235 | 130 | } | ||
236 | 131 | |||
237 | 132 | // Cover | ||
238 | 133 | /* Image { | ||
239 | 134 | anchors.fill: parent | ||
240 | 135 | |||
241 | 136 | source: { | ||
242 | 137 | if (model.cover !== "" && typeof model.cover !== "undefined") | ||
243 | 138 | return model.cover | ||
244 | 139 | |||
245 | 140 | if (model.mimetype.toString().indexOf("image") !== -1) | ||
246 | 141 | return model.path | ||
247 | 142 | |||
248 | 143 | return "" | ||
249 | 144 | } | ||
250 | 145 | |||
251 | 146 | sourceSize.width: width | ||
252 | 147 | fillMode: Image.PreserveAspectCrop | ||
253 | 148 | }*/ | ||
254 | 149 | |||
255 | 150 | // Document info overlay | ||
256 | 151 | Rectangle { | ||
257 | 152 | id: overlay | ||
258 | 153 | |||
259 | 154 | anchors { | ||
260 | 155 | left: parent.left | ||
261 | 156 | right: parent.right | ||
262 | 157 | bottom: parent.bottom | ||
263 | 158 | } | ||
264 | 159 | |||
265 | 160 | height: infoColumn.height + units.gu(1) | ||
266 | 161 | |||
267 | 162 | color: UbuntuColors.darkGrey | ||
268 | 163 | opacity: 0.75 | ||
269 | 164 | layer.enabled: true | ||
270 | 165 | |||
271 | 166 | // Document info | ||
272 | 167 | Column { | ||
273 | 168 | id: infoColumn | ||
274 | 169 | anchors { | ||
275 | 170 | left: parent.left; | ||
276 | 171 | right: parent.right | ||
277 | 172 | verticalCenter: parent.verticalCenter | ||
278 | 173 | margins: units.gu(0.5) | ||
279 | 174 | } | ||
280 | 175 | |||
281 | 176 | Label { | ||
282 | 177 | text: model.name | ||
283 | 178 | color: "white" | ||
284 | 179 | |||
285 | 180 | elide: Text.ElideRight | ||
286 | 181 | font.weight: Font.DemiBold | ||
287 | 182 | fontSize: "small" | ||
288 | 183 | |||
289 | 184 | anchors { left: parent.left; right: parent.right } | ||
290 | 185 | } | ||
291 | 186 | |||
292 | 187 | Label { | ||
293 | 188 | text: formattedDateTime() | ||
294 | 189 | color: "white" | ||
295 | 190 | fontSize: "small" | ||
296 | 191 | |||
297 | 192 | anchors { left: parent.left; right: parent.right } | ||
298 | 193 | } | ||
299 | 194 | |||
300 | 195 | Label { | ||
301 | 196 | text: Utils.printSize(i18n, model.size) | ||
302 | 197 | color: "white" | ||
303 | 198 | fontSize: "small" | ||
304 | 199 | |||
305 | 200 | anchors { left: parent.left; right: parent.right } | ||
306 | 201 | } | ||
307 | 202 | } // Document info end | ||
308 | 203 | } | ||
309 | 204 | |||
310 | 205 | states: [ | ||
311 | 206 | State { | ||
312 | 207 | name: "select" | ||
313 | 208 | when: selectionMode || selected | ||
314 | 209 | PropertyChanges { | ||
315 | 210 | target: selectionIcon | ||
316 | 211 | source: Qt.resolvedUrl("../upstreamComponents/ListItemWithActionsCheckBox.qml") | ||
317 | 212 | anchors.margins: units.gu(1) | ||
318 | 213 | } | ||
319 | 214 | } | ||
320 | 215 | ] | ||
321 | 216 | } | ||
386 | 217 | } | 113 | } |
387 | 218 | 114 | ||
388 | === modified file 'src/app/qml/documentPage/DocumentListDelegate.qml' | |||
389 | --- src/app/qml/documentPage/DocumentListDelegate.qml 2015-07-14 01:35:59 +0000 | |||
390 | +++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-08-04 16:03:21 +0000 | |||
391 | @@ -23,6 +23,8 @@ | |||
392 | 23 | import "../upstreamComponents" | 23 | import "../upstreamComponents" |
393 | 24 | 24 | ||
394 | 25 | ListItemWithActions { | 25 | ListItemWithActions { |
395 | 26 | property QtObject documentDelegateActions: DocumentDelegateActions { } | ||
396 | 27 | |||
397 | 26 | function formattedDateTime() { | 28 | function formattedDateTime() { |
398 | 27 | var date = new Date(model.date) | 29 | var date = new Date(model.date) |
399 | 28 | var diff = model.dateDiff | 30 | var diff = model.dateDiff |
400 | @@ -30,16 +32,14 @@ | |||
401 | 30 | if (sortSettings.sortMode !== 0) { // The sort rule is not "by date" | 32 | if (sortSettings.sortMode !== 0) { // The sort rule is not "by date" |
402 | 31 | switch(diff) { | 33 | switch(diff) { |
403 | 32 | case 0: // DocumentsModel.Today | 34 | case 0: // DocumentsModel.Today |
408 | 33 | // TRANSLATORS: this is a datetime formatting string, and the | 35 | // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings. |
409 | 34 | // singlequote is an escape character. | 36 | // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum |
410 | 35 | // See http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions. | 37 | return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat))) |
407 | 36 | return Qt.formatDateTime(date, i18n.tr("'Today', hh:mm")) | ||
411 | 37 | 38 | ||
412 | 38 | case 1: // DocumentsModel.Yesterday | 39 | case 1: // DocumentsModel.Yesterday |
417 | 39 | // TRANSLATORS: this is a datetime formatting string, and the | 40 | // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings. |
418 | 40 | // singlequote is an escape character. | 41 | // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum |
419 | 41 | // See http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions. | 42 | return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat))) |
416 | 42 | return Qt.formatDateTime(date, i18n.tr("'Yesterday', hh:mm")) | ||
420 | 43 | 43 | ||
421 | 44 | default: // DocumentsModel.LastWeek || DocumentsModel.LastMonth || DocumentsModel.Earlier | 44 | default: // DocumentsModel.LastWeek || DocumentsModel.LastMonth || DocumentsModel.Earlier |
422 | 45 | // TRANSLATORS: this is a datetime formatting string, | 45 | // TRANSLATORS: this is a datetime formatting string, |
423 | @@ -70,23 +70,16 @@ | |||
424 | 70 | 70 | ||
425 | 71 | locked: documentPage.state == "pickMode" | 71 | locked: documentPage.state == "pickMode" |
426 | 72 | 72 | ||
436 | 73 | // TODO: NEEDS-DESIGN: Enable left action. Still need to find an equivalent for GridDelegate. | 73 | leftSideAction: documentDelegateActions.leadingActions[0] |
437 | 74 | /* leftSideAction: Action { | 74 | rightSideActions: documentDelegateActions.trailingActions |
429 | 75 | iconName: "delete" | ||
430 | 76 | text: i18n.tr("Delete") | ||
431 | 77 | onTriggered: { | ||
432 | 78 | PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), | ||
433 | 79 | documentPage, { path: model.filePath }) | ||
434 | 80 | } | ||
435 | 81 | }*/ | ||
438 | 82 | 75 | ||
439 | 83 | contents: RowLayout { | 76 | contents: RowLayout { |
440 | 84 | anchors.fill: parent | 77 | anchors.fill: parent |
441 | 85 | spacing: units.gu(2) | 78 | spacing: units.gu(2) |
442 | 86 | 79 | ||
443 | 87 | Icon { | 80 | Icon { |
446 | 88 | width: height | 81 | Layout.preferredWidth: height |
447 | 89 | height: units.gu(5) | 82 | Layout.preferredHeight: units.gu(5) |
448 | 90 | 83 | ||
449 | 91 | // At the moment the suru icon theme doesn't have much icons. | 84 | // At the moment the suru icon theme doesn't have much icons. |
450 | 92 | name: { | 85 | name: { |
451 | 93 | 86 | ||
452 | === modified file 'src/app/qml/documentPage/SortSettingsDialog.qml' | |||
453 | --- src/app/qml/documentPage/SortSettingsDialog.qml 2015-06-10 17:17:47 +0000 | |||
454 | +++ src/app/qml/documentPage/SortSettingsDialog.qml 2015-08-04 16:03:21 +0000 | |||
455 | @@ -18,7 +18,7 @@ | |||
456 | 18 | import QtQuick 2.0 | 18 | import QtQuick 2.0 |
457 | 19 | import Ubuntu.Components 1.1 | 19 | import Ubuntu.Components 1.1 |
458 | 20 | import Ubuntu.Components.Popups 1.0 | 20 | import Ubuntu.Components.Popups 1.0 |
460 | 21 | import QtQuick.Layouts 1.0 | 21 | import QtQuick.Layouts 1.1 |
461 | 22 | 22 | ||
462 | 23 | Dialog { | 23 | Dialog { |
463 | 24 | id: sortSettingsDialog | 24 | id: sortSettingsDialog |
464 | 25 | 25 | ||
465 | === added file 'src/app/qml/documentPage/TileBase.qml' | |||
466 | --- src/app/qml/documentPage/TileBase.qml 1970-01-01 00:00:00 +0000 | |||
467 | +++ src/app/qml/documentPage/TileBase.qml 2015-08-04 16:03:21 +0000 | |||
468 | @@ -0,0 +1,369 @@ | |||
469 | 1 | /* | ||
470 | 2 | Copyright (C) 2014, 2015 Canonical Ltd. | ||
471 | 3 | |||
472 | 4 | This program is free software: you can redistribute it and/or modify | ||
473 | 5 | it under the terms of the GNU General Public License 3 as published by | ||
474 | 6 | the Free Software Foundation. | ||
475 | 7 | |||
476 | 8 | This program is distributed in the hope that it will be useful, | ||
477 | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
478 | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
479 | 11 | GNU General Public License for more details. | ||
480 | 12 | |||
481 | 13 | You should have received a copy of the GNU General Public License | ||
482 | 14 | along with this program. If not, see http://www.gnu.org/licenses/. | ||
483 | 15 | */ | ||
484 | 16 | |||
485 | 17 | import QtQuick 2.0 | ||
486 | 18 | import Ubuntu.Components 1.1 | ||
487 | 19 | import Ubuntu.Components.Popups 1.0 | ||
488 | 20 | import Ubuntu.Components.ListItems 1.0 as ListItem | ||
489 | 21 | |||
490 | 22 | AbstractButton { | ||
491 | 23 | id: root | ||
492 | 24 | |||
493 | 25 | property bool selected: false | ||
494 | 26 | property bool selectionMode: false | ||
495 | 27 | |||
496 | 28 | default property alias content: tileContent.data | ||
497 | 29 | |||
498 | 30 | property alias title: titleLabel.text | ||
499 | 31 | property alias text: textLabel.text | ||
500 | 32 | property alias subText: subTextLabel.text | ||
501 | 33 | |||
502 | 34 | // We don't really have swipe gesture here, but we anyway use the same | ||
503 | 35 | // properties' name used for UITK1.2 ListItem just for consistency. | ||
504 | 36 | property list<Action> trailingActions // Right to Left gesture in ListItem | ||
505 | 37 | property list<Action> leadingActions // Left to Right gesture in ListItem | ||
506 | 38 | |||
507 | 39 | Rectangle { | ||
508 | 40 | id: rect | ||
509 | 41 | |||
510 | 42 | anchors { fill: parent; margins: units.gu(0.5) } | ||
511 | 43 | |||
512 | 44 | color: Qt.lighter(UbuntuColors.lightGrey) | ||
513 | 45 | clip: true | ||
514 | 46 | |||
515 | 47 | Item { | ||
516 | 48 | id: tileContent | ||
517 | 49 | |||
518 | 50 | height: parent.height - captionsLayout.height * 0.3 - units.gu(2) | ||
519 | 51 | anchors { | ||
520 | 52 | left: parent.left | ||
521 | 53 | right: parent.right | ||
522 | 54 | verticalCenter: parent.verticalCenter | ||
523 | 55 | verticalCenterOffset: - captionsLayout.height * 0.3 | ||
524 | 56 | } | ||
525 | 57 | } | ||
526 | 58 | |||
527 | 59 | Loader { | ||
528 | 60 | id: overflowButton | ||
529 | 61 | |||
530 | 62 | anchors { | ||
531 | 63 | right: parent.right | ||
532 | 64 | top: parent.top | ||
533 | 65 | } | ||
534 | 66 | |||
535 | 67 | z: 10 | ||
536 | 68 | |||
537 | 69 | sourceComponent: actionsOverflowButton | ||
538 | 70 | |||
539 | 71 | onStatusChanged: { | ||
540 | 72 | if (status === Loader.Ready) { | ||
541 | 73 | item.iconName = "contextual-menu" | ||
542 | 74 | item.color = UbuntuColors.darkGrey | ||
543 | 75 | item.width = overflowButton.width | ||
544 | 76 | item.height = overflowButton.height | ||
545 | 77 | |||
546 | 78 | item.triggered.connect(function() { | ||
547 | 79 | var overflowPanel = PopupUtils.open(actionsOverflowPopoverComponent, item) | ||
548 | 80 | item.overflowPanelVisible = overflowPanel.visible; | ||
549 | 81 | |||
550 | 82 | overflowPanel.visibleChanged.connect(function() { | ||
551 | 83 | item.overflowPanelVisible = overflowPanel.visible | ||
552 | 84 | }); | ||
553 | 85 | }); | ||
554 | 86 | } | ||
555 | 87 | } | ||
556 | 88 | |||
557 | 89 | width: units.gu(5) | ||
558 | 90 | height: units.gu(5) | ||
559 | 91 | visible: rect.state !== "select" && (trailingActions.length > 0 || leadingActions.length > 0) | ||
560 | 92 | |||
561 | 93 | Behavior on opacity { | ||
562 | 94 | NumberAnimation { | ||
563 | 95 | duration: UbuntuAnimation.SnapDuration | ||
564 | 96 | } | ||
565 | 97 | } | ||
566 | 98 | } | ||
567 | 99 | |||
568 | 100 | Loader { | ||
569 | 101 | id: selectionIcon | ||
570 | 102 | |||
571 | 103 | anchors { | ||
572 | 104 | right: parent.right | ||
573 | 105 | top: parent.top | ||
574 | 106 | } | ||
575 | 107 | |||
576 | 108 | z: 10 | ||
577 | 109 | |||
578 | 110 | width: (status === Loader.Ready) ? item.implicitWidth : 0 | ||
579 | 111 | visible: (status === Loader.Ready) && (item.width === item.implicitWidth) | ||
580 | 112 | Behavior on opacity { | ||
581 | 113 | NumberAnimation { | ||
582 | 114 | duration: UbuntuAnimation.SnapDuration | ||
583 | 115 | } | ||
584 | 116 | } | ||
585 | 117 | } | ||
586 | 118 | |||
587 | 119 | // Tile captions | ||
588 | 120 | Rectangle { | ||
589 | 121 | id: captionsRect | ||
590 | 122 | |||
591 | 123 | anchors { | ||
592 | 124 | left: parent.left | ||
593 | 125 | right: parent.right | ||
594 | 126 | bottom: parent.bottom | ||
595 | 127 | } | ||
596 | 128 | |||
597 | 129 | height: captionsLayout.height + units.gu(1) | ||
598 | 130 | |||
599 | 131 | color: UbuntuColors.darkGrey | ||
600 | 132 | opacity: 0.75 | ||
601 | 133 | layer.enabled: true | ||
602 | 134 | |||
603 | 135 | Column { | ||
604 | 136 | id: captionsLayout | ||
605 | 137 | anchors { | ||
606 | 138 | left: parent.left; | ||
607 | 139 | right: parent.right | ||
608 | 140 | verticalCenter: parent.verticalCenter | ||
609 | 141 | margins: units.gu(0.5) | ||
610 | 142 | } | ||
611 | 143 | |||
612 | 144 | Label { | ||
613 | 145 | id: titleLabel | ||
614 | 146 | color: "white" | ||
615 | 147 | |||
616 | 148 | elide: Text.ElideRight | ||
617 | 149 | font.weight: Font.DemiBold | ||
618 | 150 | fontSize: "small" | ||
619 | 151 | |||
620 | 152 | anchors { left: parent.left; right: parent.right } | ||
621 | 153 | } | ||
622 | 154 | |||
623 | 155 | Label { | ||
624 | 156 | id: textLabel | ||
625 | 157 | color: "white" | ||
626 | 158 | fontSize: "small" | ||
627 | 159 | |||
628 | 160 | anchors { left: parent.left; right: parent.right } | ||
629 | 161 | } | ||
630 | 162 | |||
631 | 163 | Label { | ||
632 | 164 | id: subTextLabel | ||
633 | 165 | color: "white" | ||
634 | 166 | fontSize: "small" | ||
635 | 167 | |||
636 | 168 | anchors { left: parent.left; right: parent.right } | ||
637 | 169 | } | ||
638 | 170 | } | ||
639 | 171 | } | ||
640 | 172 | |||
641 | 173 | states: [ | ||
642 | 174 | State { | ||
643 | 175 | name: "select" | ||
644 | 176 | when: selectionMode || selected | ||
645 | 177 | PropertyChanges { | ||
646 | 178 | target: selectionIcon | ||
647 | 179 | sourceComponent: selectionCheckBox | ||
648 | 180 | anchors.margins: units.gu(1) | ||
649 | 181 | } | ||
650 | 182 | } | ||
651 | 183 | ] | ||
652 | 184 | } | ||
653 | 185 | |||
654 | 186 | // *** COMPONENTS | ||
655 | 187 | Component { | ||
656 | 188 | id: selectionCheckBox | ||
657 | 189 | |||
658 | 190 | CheckBox { | ||
659 | 191 | checked: root.selected | ||
660 | 192 | width: implicitWidth | ||
661 | 193 | // disable item mouse area to avoid conflicts with parent mouse area | ||
662 | 194 | __mouseArea.enabled: false | ||
663 | 195 | } | ||
664 | 196 | } | ||
665 | 197 | |||
666 | 198 | Component { | ||
667 | 199 | id: actionsOverflowButton | ||
668 | 200 | |||
669 | 201 | AbstractButton { | ||
670 | 202 | id: button | ||
671 | 203 | |||
672 | 204 | property alias color: icon.color | ||
673 | 205 | property bool overflowPanelVisible: false | ||
674 | 206 | |||
675 | 207 | width: visible ? units.gu(5) : 0 | ||
676 | 208 | height: parent ? parent.height : undefined | ||
677 | 209 | Rectangle { | ||
678 | 210 | visible: button.pressed || button.overflowPanelVisible | ||
679 | 211 | anchors.fill: parent | ||
680 | 212 | color: Theme.palette.selected.background | ||
681 | 213 | } | ||
682 | 214 | |||
683 | 215 | Icon { | ||
684 | 216 | id: icon | ||
685 | 217 | anchors.centerIn: parent | ||
686 | 218 | |||
687 | 219 | // prevent trying to render the icon with an invalid source | ||
688 | 220 | // when the button is invisible by setting width and height to 0 | ||
689 | 221 | width: visible ? units.gu(2.5) : 0 | ||
690 | 222 | height: visible ? units.gu(2.5) : 0 | ||
691 | 223 | source: button.iconSource | ||
692 | 224 | color: Qt.rgba(0, 0, 0, 0) | ||
693 | 225 | opacity: button.enabled ? 1.0 : 0.3 | ||
694 | 226 | } | ||
695 | 227 | |||
696 | 228 | Component { | ||
697 | 229 | id: labelComponent | ||
698 | 230 | Label { | ||
699 | 231 | id: label | ||
700 | 232 | objectName: button.objectName + "_label" | ||
701 | 233 | color: button.color | ||
702 | 234 | opacity: button.enabled ? 1.0 : 0.3 | ||
703 | 235 | text: button.text | ||
704 | 236 | fontSize: "xx-small" | ||
705 | 237 | } | ||
706 | 238 | } | ||
707 | 239 | Loader { | ||
708 | 240 | anchors { | ||
709 | 241 | top: icon.bottom | ||
710 | 242 | topMargin: units.gu(0.5) | ||
711 | 243 | horizontalCenter: parent.horizontalCenter | ||
712 | 244 | } | ||
713 | 245 | sourceComponent: button.state === "IconAndLabel" ? labelComponent : null | ||
714 | 246 | } | ||
715 | 247 | } | ||
716 | 248 | } | ||
717 | 249 | |||
718 | 250 | Component { | ||
719 | 251 | id: actionsOverflowPopoverComponent | ||
720 | 252 | |||
721 | 253 | Popover { | ||
722 | 254 | id: actionsOverflowPopover | ||
723 | 255 | property bool square: true | ||
724 | 256 | callerMargin: -units.gu(1) + units.dp(4) | ||
725 | 257 | contentWidth: units.gu(20) | ||
726 | 258 | contentHeight: popoverActionsLayout.height | ||
727 | 259 | |||
728 | 260 | Connections { | ||
729 | 261 | target: root | ||
730 | 262 | onLeadingActionsChanged: { | ||
731 | 263 | actionsOverflowPopover.hide(); | ||
732 | 264 | } | ||
733 | 265 | onTrailingActionsChanged: { | ||
734 | 266 | actionsOverflowPopover.hide(); | ||
735 | 267 | } | ||
736 | 268 | } | ||
737 | 269 | |||
738 | 270 | Column { | ||
739 | 271 | id: popoverActionsLayout | ||
740 | 272 | anchors { | ||
741 | 273 | left: parent.left | ||
742 | 274 | top: parent.top | ||
743 | 275 | right: parent.right | ||
744 | 276 | } | ||
745 | 277 | Repeater { | ||
746 | 278 | id: overflowTrailingRepeater | ||
747 | 279 | model: root.trailingActions | ||
748 | 280 | |||
749 | 281 | delegate: overflowPanelDelegate | ||
750 | 282 | onItemAdded: { | ||
751 | 283 | item.action = model[index] | ||
752 | 284 | item.clicked.connect(function() { | ||
753 | 285 | actionsOverflowPopover.hide() | ||
754 | 286 | }) | ||
755 | 287 | |||
756 | 288 | item.showDivider = (overflowLeadingRepeater.count === 0) ? (index !== overflowTrailingRepeater.count - 1) : true | ||
757 | 289 | } | ||
758 | 290 | } | ||
759 | 291 | |||
760 | 292 | Repeater { | ||
761 | 293 | id: overflowLeadingRepeater | ||
762 | 294 | model: root.leadingActions | ||
763 | 295 | |||
764 | 296 | delegate: overflowPanelDelegate | ||
765 | 297 | onItemAdded: { | ||
766 | 298 | item.action = model[index] | ||
767 | 299 | item.clicked.connect(function() { | ||
768 | 300 | actionsOverflowPopover.hide() | ||
769 | 301 | }) | ||
770 | 302 | |||
771 | 303 | item.showDivider = (index !== overflowLeadingRepeater.count - 1) | ||
772 | 304 | } | ||
773 | 305 | } | ||
774 | 306 | } | ||
775 | 307 | } | ||
776 | 308 | } | ||
777 | 309 | |||
778 | 310 | Component { | ||
779 | 311 | id: overflowPanelDelegate | ||
780 | 312 | |||
781 | 313 | AbstractButton { | ||
782 | 314 | id: rootItem | ||
783 | 315 | implicitHeight: units.gu(6) + bottomDividerLine.height | ||
784 | 316 | width: parent ? parent.width : units.gu(31) | ||
785 | 317 | |||
786 | 318 | property bool showDivider: true | ||
787 | 319 | property color foregroundColor: Theme.palette.selected.backgroundText | ||
788 | 320 | |||
789 | 321 | Rectangle { | ||
790 | 322 | visible: parent.pressed | ||
791 | 323 | anchors { | ||
792 | 324 | left: parent.left | ||
793 | 325 | right: parent.right | ||
794 | 326 | top: parent.top | ||
795 | 327 | } | ||
796 | 328 | height: parent.height - bottomDividerLine.height | ||
797 | 329 | color: Theme.palette.selected.background | ||
798 | 330 | } | ||
799 | 331 | |||
800 | 332 | Icon { | ||
801 | 333 | id: actionIcon | ||
802 | 334 | source: action.iconSource | ||
803 | 335 | color: rootItem.foregroundColor | ||
804 | 336 | anchors { | ||
805 | 337 | verticalCenter: parent.verticalCenter | ||
806 | 338 | verticalCenterOffset: units.dp(-1) | ||
807 | 339 | left: parent.left | ||
808 | 340 | leftMargin: units.gu(2) | ||
809 | 341 | } | ||
810 | 342 | width: units.gu(2) | ||
811 | 343 | height: units.gu(2) | ||
812 | 344 | opacity: action.enabled ? 1.0 : 0.5 | ||
813 | 345 | } | ||
814 | 346 | |||
815 | 347 | Label { | ||
816 | 348 | anchors { | ||
817 | 349 | verticalCenter: parent.verticalCenter | ||
818 | 350 | verticalCenterOffset: units.dp(-1) | ||
819 | 351 | left: actionIcon.right | ||
820 | 352 | leftMargin: units.gu(2) | ||
821 | 353 | right: parent.right | ||
822 | 354 | } | ||
823 | 355 | fontSize: "small" | ||
824 | 356 | elide: Text.ElideRight | ||
825 | 357 | text: action.text | ||
826 | 358 | color: rootItem.foregroundColor | ||
827 | 359 | opacity: action.enabled ? 1.0 : 0.5 | ||
828 | 360 | } | ||
829 | 361 | |||
830 | 362 | ListItem.ThinDivider { | ||
831 | 363 | id: bottomDividerLine | ||
832 | 364 | anchors.bottom: parent.bottom | ||
833 | 365 | visible: rootItem.showDivider | ||
834 | 366 | } | ||
835 | 367 | } | ||
836 | 368 | } | ||
837 | 369 | } | ||
838 | 0 | 370 | ||
839 | === modified file 'src/plugin/file-qml-plugin/documentmodel.cpp' | |||
840 | --- src/plugin/file-qml-plugin/documentmodel.cpp 2015-07-14 01:35:59 +0000 | |||
841 | +++ src/plugin/file-qml-plugin/documentmodel.cpp 2015-08-04 16:03:21 +0000 | |||
842 | @@ -240,15 +240,9 @@ | |||
843 | 240 | QString rootPath = volume.rootPath(); | 240 | QString rootPath = volume.rootPath(); |
844 | 241 | 241 | ||
845 | 242 | if (rootPath.startsWith("/media/")) { | 242 | if (rootPath.startsWith("/media/")) { |
846 | 243 | // In a Unix filesystem, names are case sentitive. | ||
847 | 244 | // For that reason we need to check twice. | ||
848 | 245 | QDir dir; | 243 | QDir dir; |
849 | 246 | |||
850 | 247 | dir.setPath(rootPath + "/Documents"); | 244 | dir.setPath(rootPath + "/Documents"); |
851 | 248 | if (dir.exists()) | ||
852 | 249 | m_docsMonitor->addDirectory(dir.canonicalPath()); | ||
853 | 250 | 245 | ||
854 | 251 | dir.setPath(rootPath + "/documents"); | ||
855 | 252 | if (dir.exists()) | 246 | if (dir.exists()) |
856 | 253 | m_docsMonitor->addDirectory(dir.canonicalPath()); | 247 | m_docsMonitor->addDirectory(dir.canonicalPath()); |
857 | 254 | } | 248 | } |
858 | 255 | 249 | ||
859 | === modified file 'src/plugin/poppler-qml-plugin/CMakeLists.txt' | |||
860 | --- src/plugin/poppler-qml-plugin/CMakeLists.txt 2015-04-15 14:47:28 +0000 | |||
861 | +++ src/plugin/poppler-qml-plugin/CMakeLists.txt 2015-08-04 16:03:21 +0000 | |||
862 | @@ -11,7 +11,6 @@ | |||
863 | 11 | plugin.cpp | 11 | plugin.cpp |
864 | 12 | pdfdocument.cpp | 12 | pdfdocument.cpp |
865 | 13 | pdfimageprovider.cpp | 13 | pdfimageprovider.cpp |
866 | 14 | pdfthread.cpp | ||
867 | 15 | pdfitem.cpp | 14 | pdfitem.cpp |
868 | 16 | verticalview.cpp | 15 | verticalview.cpp |
869 | 17 | pdftocmodel.cpp | 16 | pdftocmodel.cpp |
870 | @@ -23,7 +22,7 @@ | |||
871 | 23 | 22 | ||
872 | 24 | target_link_libraries(popplerqmlplugin poppler-qt5) | 23 | target_link_libraries(popplerqmlplugin poppler-qt5) |
873 | 25 | 24 | ||
875 | 26 | qt5_use_modules(popplerqmlplugin Gui Qml Quick Xml) | 25 | qt5_use_modules(popplerqmlplugin Gui Qml Quick Xml Concurrent) |
876 | 27 | 26 | ||
877 | 28 | # Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator | 27 | # Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator |
878 | 29 | if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") | 28 | if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") |
879 | 30 | 29 | ||
880 | === modified file 'src/plugin/poppler-qml-plugin/pdfdocument.cpp' | |||
881 | --- src/plugin/poppler-qml-plugin/pdfdocument.cpp 2015-03-25 16:51:53 +0000 | |||
882 | +++ src/plugin/poppler-qml-plugin/pdfdocument.cpp 2015-08-04 16:03:21 +0000 | |||
883 | @@ -19,13 +19,13 @@ | |||
884 | 19 | 19 | ||
885 | 20 | #include "pdfdocument.h" | 20 | #include "pdfdocument.h" |
886 | 21 | #include "pdfimageprovider.h" | 21 | #include "pdfimageprovider.h" |
887 | 22 | #include "pdfthread.h" | ||
888 | 23 | 22 | ||
889 | 24 | #include <poppler/qt5/poppler-qt5.h> | 23 | #include <poppler/qt5/poppler-qt5.h> |
890 | 25 | #include <QDebug> | 24 | #include <QDebug> |
891 | 26 | #include <QQmlEngine> | 25 | #include <QQmlEngine> |
892 | 27 | #include <QQmlContext> | 26 | #include <QQmlContext> |
894 | 28 | #include <QThread> | 27 | |
895 | 28 | #include <QtConcurrent/QtConcurrent> | ||
896 | 29 | 29 | ||
897 | 30 | PdfDocument::PdfDocument(QAbstractListModel *parent): | 30 | PdfDocument::PdfDocument(QAbstractListModel *parent): |
898 | 31 | QAbstractListModel(parent) | 31 | QAbstractListModel(parent) |
899 | @@ -145,12 +145,15 @@ | |||
900 | 145 | if (!m_document) | 145 | if (!m_document) |
901 | 146 | return false; | 146 | return false; |
902 | 147 | 147 | ||
909 | 148 | PdfThread *pdfThread = new PdfThread(); | 148 | Poppler::Document* document = m_document; |
910 | 149 | pdfThread->setDocument(m_document); | 149 | QtConcurrent::run( [=] { |
911 | 150 | 150 | PdfPagesList pages; | |
912 | 151 | connect(pdfThread, SIGNAL(resultReady(PdfPagesList)), this, SLOT(_q_populate(PdfPagesList))); | 151 | |
913 | 152 | connect(pdfThread, SIGNAL(finished()), pdfThread, SLOT(deleteLater())); | 152 | for( int i = 0; i < document->numPages(); ++i ) |
914 | 153 | pdfThread->start(); | 153 | pages.append(document->page(i)); |
915 | 154 | |||
916 | 155 | QMetaObject::invokeMethod(this, "_q_populate", Qt::QueuedConnection, Q_ARG(PdfPagesList, pages)); | ||
917 | 156 | }); | ||
918 | 154 | 157 | ||
919 | 155 | return true; | 158 | return true; |
920 | 156 | } | 159 | } |
921 | 157 | 160 | ||
922 | === removed file 'src/plugin/poppler-qml-plugin/pdfthread.cpp' | |||
923 | --- src/plugin/poppler-qml-plugin/pdfthread.cpp 2015-01-30 18:42:00 +0000 | |||
924 | +++ src/plugin/poppler-qml-plugin/pdfthread.cpp 1970-01-01 00:00:00 +0000 | |||
925 | @@ -1,35 +0,0 @@ | |||
926 | 1 | /* | ||
927 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
928 | 3 | * | ||
929 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
930 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
931 | 6 | * by the Free Software Foundation. | ||
932 | 7 | * | ||
933 | 8 | * This program is distributed in the hope that it will be useful, but | ||
934 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
935 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
936 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
937 | 12 | * | ||
938 | 13 | * You should have received a copy of the GNU General Public License along | ||
939 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
940 | 15 | * | ||
941 | 16 | * Author: Stefano Verzegnassi <stefano92.100@gmail.com> | ||
942 | 17 | */ | ||
943 | 18 | |||
944 | 19 | #include "pdfthread.h" | ||
945 | 20 | #include <QDebug> | ||
946 | 21 | |||
947 | 22 | void PdfThread::run() | ||
948 | 23 | { | ||
949 | 24 | PdfPagesList pages; | ||
950 | 25 | |||
951 | 26 | for( int i=0; i<m_document->numPages(); i++ ) | ||
952 | 27 | pages.append(m_document->page(i)); | ||
953 | 28 | |||
954 | 29 | Q_EMIT resultReady(pages); | ||
955 | 30 | } | ||
956 | 31 | |||
957 | 32 | void PdfThread::setDocument(Poppler::Document *document) | ||
958 | 33 | { | ||
959 | 34 | m_document = document; | ||
960 | 35 | } | ||
961 | 36 | 0 | ||
962 | === removed file 'src/plugin/poppler-qml-plugin/pdfthread.h' | |||
963 | --- src/plugin/poppler-qml-plugin/pdfthread.h 2015-01-30 18:42:00 +0000 | |||
964 | +++ src/plugin/poppler-qml-plugin/pdfthread.h 1970-01-01 00:00:00 +0000 | |||
965 | @@ -1,42 +0,0 @@ | |||
966 | 1 | /* | ||
967 | 2 | * Copyright (C) 2014-2015 Canonical, Ltd. | ||
968 | 3 | * | ||
969 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
970 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
971 | 6 | * by the Free Software Foundation. | ||
972 | 7 | * | ||
973 | 8 | * This program is distributed in the hope that it will be useful, but | ||
974 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
975 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
976 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
977 | 12 | * | ||
978 | 13 | * You should have received a copy of the GNU General Public License along | ||
979 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
980 | 15 | * | ||
981 | 16 | * Author: Stefano Verzegnassi <stefano92.100@gmail.com> | ||
982 | 17 | */ | ||
983 | 18 | |||
984 | 19 | #ifndef PDFTHREAD_H | ||
985 | 20 | #define PDFTHREAD_H | ||
986 | 21 | |||
987 | 22 | #include <QThread> | ||
988 | 23 | #include <poppler/qt5/poppler-qt5.h> | ||
989 | 24 | |||
990 | 25 | typedef QList<Poppler::Page*> PdfPagesList; | ||
991 | 26 | |||
992 | 27 | class PdfThread : public QThread | ||
993 | 28 | { | ||
994 | 29 | Q_OBJECT | ||
995 | 30 | |||
996 | 31 | public: | ||
997 | 32 | void run(); | ||
998 | 33 | void setDocument(Poppler::Document *document); | ||
999 | 34 | |||
1000 | 35 | Q_SIGNALS: | ||
1001 | 36 | void resultReady(PdfPagesList pages); | ||
1002 | 37 | |||
1003 | 38 | private: | ||
1004 | 39 | Poppler::Document *m_document; | ||
1005 | 40 | }; | ||
1006 | 41 | |||
1007 | 42 | #endif // PDFTHREAD_H |
FAILED: Continuous integration, rev:170 91.189. 93.70:8080/ job/ubuntu- docviewer- app-reboot- ci/4/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 3174/console 91.189. 93.70:8080/ job/ubuntu- docviewer- app-reboot- utopic- amd64-ci/ 4/console 91.189. 93.70:8080/ job/ubuntu- docviewer- app-reboot- vivid-amd64- ci/4/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- docviewer- app-reboot- ci/4/rebuild
http://