Merge lp:~dpm/ubuntu-docviewer-app/toolbar-fix into lp:ubuntu-docviewer-app/trunk

Proposed by Daniel Holm
Status: Rejected
Rejected by: Anthony Granger
Proposed branch: lp:~dpm/ubuntu-docviewer-app/toolbar-fix
Merge into: lp:ubuntu-docviewer-app/trunk
Diff against target: 126 lines (+28/-17)
4 files modified
ImageView.qml (+1/-1)
PdfView.qml (+1/-1)
TextView.qml (+1/-1)
ubuntu-docviewer-app.qml (+25/-14)
To merge this branch: bzr merge lp:~dpm/ubuntu-docviewer-app/toolbar-fix
Reviewer Review Type Date Requested Status
Anthony Granger Disapprove
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+186499@code.launchpad.net

Commit message

Updated Toolbar API

Description of the change

Why is this not already proposed? The app doesn't run with the old toolbar code.

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
Anthony Granger (chocanto) wrote :

It's ok, I have fix the bug in the "file-qml" branch !

Thank you !

review: Disapprove

Unmerged revisions

21. By David Planella

Merged from Anthony Granger's branch

20. By David Planella

Migrated to the new Toolbar API

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ImageView.qml'
2--- ImageView.qml 2013-06-30 15:10:38 +0000
3+++ ImageView.qml 2013-09-19 10:49:09 +0000
4@@ -11,7 +11,7 @@
5 id: image
6 objectName: "imageItem"
7
8- source: file.getPath()
9+ source: file.path
10 smooth: true
11 fillMode: Image.PreserveAspectFit
12 width: parent.width
13
14=== modified file 'PdfView.qml'
15--- PdfView.qml 2013-08-09 12:55:12 +0000
16+++ PdfView.qml 2013-09-19 10:49:09 +0000
17@@ -11,7 +11,7 @@
18
19 Poppler {
20 id: popplerProp
21- path: file.getPath()
22+ path: file.path
23 }
24
25 Column {
26
27=== modified file 'TextView.qml'
28--- TextView.qml 2013-06-28 22:42:59 +0000
29+++ TextView.qml 2013-09-19 10:49:09 +0000
30@@ -34,7 +34,7 @@
31 Component.onCompleted: {
32 var xhr = new XMLHttpRequest;
33
34- xhr.open("GET", file.getPath());
35+ xhr.open("GET", file.path);
36 xhr.onreadystatechange = function() {
37 if (xhr.readyState === XMLHttpRequest.DONE) {
38 textAreaMain.text = xhr.responseText;
39
40=== modified file 'ubuntu-docviewer-app.qml'
41--- ubuntu-docviewer-app.qml 2013-06-28 23:01:02 +0000
42+++ ubuntu-docviewer-app.qml 2013-09-19 10:49:09 +0000
43@@ -3,6 +3,8 @@
44 import Ubuntu.Components.Popups 0.1
45 import Ubuntu.Components.ListItems 0.1 as ListItem
46
47+import org.docviewer.file 1.0
48+
49 import "utils.js" as Utils
50 import "loadComponent.js" as LoadComponent
51
52@@ -21,6 +23,23 @@
53 Component.onDestruction: {
54
55 }
56+
57+ Arguments {
58+ id: args
59+
60+ defaultArgument.help: "Path of the document"
61+ defaultArgument.valueNames: ["path"]
62+ }
63+
64+ File {
65+ id: file
66+ path: args.defaultArgument.at(0)
67+
68+ onMimetypeChanged: {
69+ mimetypeItem.value = file.mimetype;
70+ LoadComponent.load(file.mimetype);
71+ }
72+ }
73
74 Tabs {
75 id: tabs
76@@ -30,12 +49,12 @@
77 objectName: "tabViewer"
78 id: tabViewer;
79
80- title: Utils.getNameOfFile(file.getPath());
81+ title: Utils.getNameOfFile(file.path);
82
83 page: Page {
84 id: pageMain
85
86- tools: ToolbarActions {
87+ tools: ToolbarItems {
88 back {
89 visible: true
90 }
91@@ -55,31 +74,23 @@
92 width: units.gu(50)
93 ListItem.SingleValue {
94 text: i18n.tr("Location")
95- value: file.getPath()
96+ value: file.path
97 }
98 ListItem.SingleValue {
99 text: i18n.tr("Size")
100- value: Utils.printSize(file.getSize())
101+ value: Utils.printSize(file.size)
102 }
103
104 ListItem.SingleValue {
105 text: i18n.tr("Last modified")
106- value: qsTr("%1").arg(file.getLastModified().toLocaleString(Qt.locale()))
107+ value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale()))
108 }
109
110 ListItem.SingleValue {
111 id: mimetypeItem
112 objectName: "mimetypeItem"
113 text: i18n.tr("Mimetype")
114- value: file.getMimetype()
115- }
116-
117- Connections {
118- target: file
119- onMimetypeChanged: {
120- mimetypeItem.value = file.getMimetype();
121- LoadComponent.load(file.getMimetype());
122- }
123+ value: "none"
124 }
125 }
126 }

Subscribers

People subscribed via source and target branches