Merge lp:~carlos-mazieri/ubuntu-filemanager-app/app-bug-properties-Unknown into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Michael Spencer
Approved revision: 66
Merged at revision: 69
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/app-bug-properties-Unknown
Merge into: lp:ubuntu-filemanager-app
Diff against target: 94 lines (+45/-7)
2 files modified
FileDetailsPopover.qml (+3/-3)
FolderListPage.qml (+42/-4)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/app-bug-properties-Unknown
Reviewer Review Type Date Requested Status
Michael Spencer Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+188202@code.launchpad.net

Commit message

Description of the change

It was a mistake to create the properties: pathAccessedDate, pathModifiedDate, pathCreatedDate and pathIsWritable.

They should have be created as Q_INVOKABLE functions, the bug https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1198858 happens due to those properties do not have signals to notify their changes.

This change fix the problem and allows to change the plugin keeping the file manager working.

A plugin change already done can be reached at https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/model-bug-properties-Unknown

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: Approve (continuous-integration)
Revision history for this message
Michael Spencer (ibelieve) wrote :

I haven't tested this, but it looks like it should work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'FileDetailsPopover.qml'
2--- FileDetailsPopover.qml 2013-08-06 17:40:06 +0000
3+++ FileDetailsPopover.qml 2013-09-28 19:05:26 +0000
4@@ -36,7 +36,7 @@
5 if (model.isReadable) {
6 permissions.push(i18n.tr("Readable"))
7 }
8- if (model.isWritable) {
9+ if (pathIsWritable()) {
10 permissions.push(i18n.tr("Writable"))
11 }
12 if (model.isExecutable) {
13@@ -113,7 +113,7 @@
14 color: Theme.palette.normal.overlayText
15 }
16 Label {
17- text: dateTimeFormat(model.accessedDate)
18+ text: dateTimeFormat(pathAccessedDate())
19 color: Theme.palette.normal.overlayText
20 }
21
22@@ -122,7 +122,7 @@
23 color: Theme.palette.normal.overlayText
24 }
25 Label {
26- text: dateTimeFormat(model.modifiedDate)
27+ text: dateTimeFormat(pathModifiedDate())
28 color: Theme.palette.normal.overlayText
29 }
30
31
32=== modified file 'FolderListPage.qml'
33--- FolderListPage.qml 2013-09-17 16:47:57 +0000
34+++ FolderListPage.qml 2013-09-28 19:05:26 +0000
35@@ -88,6 +88,47 @@
36 pageModel.refresh()
37 }
38
39+ // For these 3 functions: pathAccessedDate(), pathModifiedDate() and pathModifiedDate()
40+ // we are using a temporary construction to ask if a such property exists in the model
41+ //
42+ // Right now all properties exist: "pathAccessedDate", "pathModifiedDate" and "pathIsWritable"
43+ // but they will be removed and the corresponding READ functions: pathAccessedDate(),
44+ // pathModifiedDate() and pathIsWritable() will become Q_INVOKABLE() replacing the prefix "path" for
45+ // "curPath".
46+ // This construction will allow the File Manager to keep working while we change the model
47+ // after changing the model, this construction can be removed
48+
49+ function pathAccessedDate() {
50+ if ("pathAccessedDate" in pageModel) {
51+ console.log("using property pathAccessedDate")
52+ return pageModel.pathAccessedDate
53+ }
54+ else {
55+ console.log("calling method pageModel.curPathAccessedDate()")
56+ return pageModel.curPathAccessedDate()
57+ }
58+ }
59+ function pathModifiedDate() {
60+ if ("pathModifiedDate" in pageModel) {
61+ console.log("using property pathModifiedDate")
62+ return pageModel.pathModifiedDate
63+ }
64+ else {
65+ console.log("calling method pageModel.curPathModifiedDate()")
66+ return pageModel.curPathModifiedDate()
67+ }
68+ }
69+ function pathIsWritable() {
70+ if ("pathIsWritable" in pageModel) {
71+ console.log("using property pathIsWritable");
72+ return pageModel.pathIsWritable
73+ }
74+ else {
75+ console.log("calling method pageModel.curPathIsWritable()")
76+ return pageModel.curPathIsWritable()
77+ }
78+ }
79+
80 // FIXME: hard coded path for icon, assumes Ubuntu desktop icon available.
81 // Nemo mobile has icon provider. Have to figure out what's the proper way
82 // to get "system wide" icons in Ubuntu Touch, or if we have to use
83@@ -181,10 +222,7 @@
84 property string fileName: pathName(pageModel.path)
85 property string fileSize: (folderListView.count === 1
86 ? i18n.tr("1 file")
87- : i18n.tr("%1 files").arg(folderListView.count))
88- property date accessedDate: pageModel.pathAccessedDate
89- property date modifiedDate: pageModel.pathModifiedDate
90- property bool isWritable: pageModel.pathIsWritable
91+ : i18n.tr("%1 files").arg(folderListView.count))
92 property bool isReadable: true
93 property bool isExecutable: true
94 }

Subscribers

People subscribed via source and target branches