Merge lp:~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri on 2015-10-01
Status: Merged
Approved by: Arto Jalkanen on 2015-10-01
Approved revision: 474
Merged at revision: 476
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-crash-fix
Diff against target: 61 lines (+14/-4)
4 files modified
src/app/qml/components/FolderIconDelegate.qml (+2/-2)
src/app/qml/components/FolderListDelegate.qml (+1/-1)
src/app/qml/ui/FolderListPage.qml (+10/-0)
src/plugin/folderlistmodel/dirmodel.cpp (+1/-1)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-10-01 Approve on 2015-10-01
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-10-01
Review via email: mp+273001@code.launchpad.net

Commit message

Show the size of directories: (it is the number of items) for local file systems and "Unknown" for remote locations
Show nothing if the last modified date is not available

Description of the change

Show the size of directories: (it is the number of items) for local file systems and "Unknown" for remote locations
Show nothing if the last modified date is not available

To post a comment you must log in.
review: Approve (continuous-integration)
Arto Jalkanen (ajalkane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/components/FolderIconDelegate.qml'
2--- src/app/qml/components/FolderIconDelegate.qml 2015-09-06 00:11:02 +0000
3+++ src/app/qml/components/FolderIconDelegate.qml 2015-10-01 00:11:58 +0000
4@@ -49,8 +49,8 @@
5 property string fileName: model.fileName
6 property string filePath: fileView.folder + '/' + fileName
7
8- property string text: fileName
9- property string subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
10+ property string text: fileName
11+ property string subText: itemDateAndSize(model)
12
13 property var icon: fileIcon(filePath, model)
14
15
16=== modified file 'src/app/qml/components/FolderListDelegate.qml'
17--- src/app/qml/components/FolderListDelegate.qml 2015-09-06 00:11:02 +0000
18+++ src/app/qml/components/FolderListDelegate.qml 2015-10-01 00:11:58 +0000
19@@ -27,7 +27,7 @@
20 property string filePath: path
21
22 text: model.fileName
23- subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
24+ subText: itemDateAndSize(model)
25
26 property string path: fileView.folder + '/' + model.fileName
27 iconSource: fileIcon(path, model)
28
29=== modified file 'src/app/qml/ui/FolderListPage.qml'
30--- src/app/qml/ui/FolderListPage.qml 2015-09-20 20:28:26 +0000
31+++ src/app/qml/ui/FolderListPage.qml 2015-10-01 00:11:58 +0000
32@@ -774,6 +774,16 @@
33 return pageModel.curPathIsWritable()
34 }
35
36+ function itemDateAndSize(model) {
37+ var strDate = Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate);
38+ //local file systems always have date and size for both files and directories
39+ //remote file systems may have not size for directories, it comes as "Unknown"
40+ if (strDate) {
41+ strDate += ", " + model.fileSize //show the size even it is "Unknown"
42+ }
43+ return strDate;
44+ }
45+
46 // FIXME: hard coded path for icon, assumes Ubuntu desktop icon available.
47 // Nemo mobile has icon provider. Have to figure out what's the proper way
48 // to get "system wide" icons in Ubuntu Touch, or if we have to use
49
50=== modified file 'src/plugin/folderlistmodel/dirmodel.cpp'
51--- src/plugin/folderlistmodel/dirmodel.cpp 2015-09-20 20:44:29 +0000
52+++ src/plugin/folderlistmodel/dirmodel.cpp 2015-10-01 00:11:58 +0000
53@@ -370,7 +370,7 @@
54 }
55 //it is possible to browse network folders and get its
56 //number of items, but it may take longer
57- return tr("unkown");
58+ return tr("Unknown");
59 }
60 return fileSize(fi.size());
61 }

Subscribers

People subscribed via source and target branches