Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03 into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri on 2015-09-07
Status: Merged
Approved by: Arto Jalkanen on 2015-09-08
Approved revision: 460
Merged at revision: 468
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-02
Diff against target: 90 lines (+21/-11)
4 files modified
src/app/qml/components/FolderIconDelegate.qml (+1/-1)
src/app/qml/components/FolderListDelegate.qml (+2/-2)
src/app/qml/components/PlacesSidebar.qml (+1/-1)
src/app/qml/ui/FolderListPage.qml (+17/-7)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-09-07 Approve on 2015-09-08
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-09-07
Review via email: mp+270337@code.launchpad.net

Commit message

mproved icon chooser based on the model data
added icon for remote places

Description of the change

Improved icon chooser based on the model data

Added icon for remote places and hosts

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 2014-09-20 10:49:51 +0000
3+++ src/app/qml/components/FolderIconDelegate.qml 2015-09-07 21:29:26 +0000
4@@ -52,7 +52,7 @@
5 property string text: fileName
6 property string subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
7
8- property var icon: fileIcon(filePath, model.isDir)
9+ property var icon: fileIcon(filePath, model)
10
11 Item {
12 anchors {
13
14=== modified file 'src/app/qml/components/FolderListDelegate.qml'
15--- src/app/qml/components/FolderListDelegate.qml 2014-09-20 10:49:51 +0000
16+++ src/app/qml/components/FolderListDelegate.qml 2015-09-07 21:29:26 +0000
17@@ -30,9 +30,9 @@
18 subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
19
20 property string path: fileView.folder + '/' + model.fileName
21- iconSource: fileIcon(path, model.isDir)
22+ iconSource: fileIcon(path, model)
23
24- progression: model.isDir
25+ progression: model.isBrowsable
26 iconFrame: false
27
28 selected: model.isSelected
29
30=== modified file 'src/app/qml/components/PlacesSidebar.qml'
31--- src/app/qml/components/PlacesSidebar.qml 2015-01-01 20:43:56 +0000
32+++ src/app/qml/components/PlacesSidebar.qml 2015-09-07 21:29:26 +0000
33@@ -80,7 +80,7 @@
34 }
35 }
36
37- iconSource: model.icon || fileIcon(model.path, true)
38+ iconSource: model.icon || fileIcon(model.path) //using only path, model is null
39
40 onClicked: {
41 goTo(model.path)
42
43=== modified file 'src/app/qml/ui/FolderListPage.qml'
44--- src/app/qml/ui/FolderListPage.qml 2015-08-28 10:37:28 +0000
45+++ src/app/qml/ui/FolderListPage.qml 2015-09-07 21:29:26 +0000
46@@ -771,12 +771,18 @@
47 // to get "system wide" icons in Ubuntu Touch, or if we have to use
48 // icons packaged into the application. Both folder and individual
49 // files will need an icon.
50- // TODO: Remove isDir parameter and use new model functions
51- function fileIcon(file, isDir) {
52- var iconPath = isDir ? "/usr/share/icons/Humanity/places/48/folder.svg"
53- : "/usr/share/icons/Humanity/mimes/48/empty.svg"
54-
55- if (file === userplaces.locationHome) {
56+
57+ function fileIcon(file, model) {
58+ var iconPath = model ? "/usr/share/icons/Humanity/mimes/48/empty.svg" :
59+ "/usr/share/icons/Humanity/places/48/folder.svg"
60+
61+ if (model && model.isSmbWorkgroup) {
62+ iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
63+ } else if (model && model.isHost) {
64+ iconPath = "/usr/share/icons/Humanity/places/48/server.svg"
65+ } else if (model && model.isBrowsable) {
66+ iconPath = "/usr/share/icons/Humanity/places/48/folder.svg"
67+ } else if (file === userplaces.locationHome) {
68 iconPath = "../icons/folder-home.svg"
69 } else if (file === i18n.tr("~/Desktop")) {
70 iconPath = "/usr/share/icons/Humanity/places/48/user-desktop.svg"
71@@ -798,7 +804,9 @@
72 iconPath = "/usr/share/icons/Humanity/places/48/folder-videos.svg"
73 } else if (file === "/") {
74 iconPath = "/usr/share/icons/Humanity/devices/48/drive-harddisk.svg"
75- } else if (userplaces.isUserMountDirectory(file)) {
76+ } else if (file === userplaces.locationSamba) {
77+ iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
78+ } else if (userplaces.isUserMountDirectory(file)) {
79 // In context of Ubuntu Touch this means SDCard currently.
80 iconPath = "/usr/share/icons/Humanity/devices/48/drive-removable-media.svg"
81 }
82@@ -811,6 +819,8 @@
83 return i18n.tr("Home")
84 } else if (folder === "/") {
85 return i18n.tr("Device")
86+ } else if (folder === userplaces.locationSamba) {
87+ return i18n.tr("Network")
88 } else {
89 return basename(folder)
90 }

Subscribers

People subscribed via source and target branches