Merge lp:~renatofilho/ubuntu-filemanager-app/no-hardcoded-icons into lp:ubuntu-filemanager-app

Proposed by Renato Araujo Oliveira Filho on 2016-10-06
Status: Merged
Approved by: Bill Filler on 2016-10-06
Approved revision: 575
Merged at revision: 574
Proposed branch: lp:~renatofilho/ubuntu-filemanager-app/no-hardcoded-icons
Merge into: lp:ubuntu-filemanager-app
Diff against target: 119 lines (+27/-23)
2 files modified
src/app/qml/ui/FileDetailsPopover.qml (+4/-0)
src/app/qml/ui/FolderListPage.qml (+23/-23)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-filemanager-app/no-hardcoded-icons
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve on 2016-10-06
Ubuntu File Manager Developers 2016-10-06 Pending
Review via email: mp+307857@code.launchpad.net

Commit message

Do not use hardcoded paths for icons.

To post a comment you must log in.
review: Approve (continuous-integration)
575. By Renato Araujo Oliveira Filho on 2016-10-06

Limit the icon size used on Details page.

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/FileDetailsPopover.qml'
2--- src/app/qml/ui/FileDetailsPopover.qml 2016-04-06 14:51:26 +0000
3+++ src/app/qml/ui/FileDetailsPopover.qml 2016-10-06 15:39:03 +0000
4@@ -72,6 +72,10 @@
5
6 // TODO: how to get proper icon?
7 source: fileIcon(root.path, model.isDir)
8+ sourceSize {
9+ width: 48
10+ height: 48
11+ }
12 }
13
14 Label {
15
16=== modified file 'src/app/qml/ui/FolderListPage.qml'
17--- src/app/qml/ui/FolderListPage.qml 2016-07-25 12:19:21 +0000
18+++ src/app/qml/ui/FolderListPage.qml 2016-10-06 15:39:03 +0000
19@@ -574,7 +574,7 @@
20 Action {
21 text: i18n.tr("Cut")
22 // TODO: temporary
23- iconSource: "/usr/share/icons/Humanity/actions/48/edit-cut.svg"
24+ iconSource: "image://theme/edit-cut"
25 onTriggered: {
26 console.log("Cut on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
27 pageModel.cutIndex(actionSelectionPopover.model.index)
28@@ -585,7 +585,7 @@
29 Action {
30 text: i18n.tr("Copy")
31 // TODO: temporary.
32- iconSource: "/usr/share/icons/Humanity/actions/48/edit-copy.svg"
33+ iconSource: "image://theme/edit-copy"
34
35 onTriggered: {
36 console.log("Copy on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
37@@ -597,7 +597,7 @@
38 Action {
39 text: i18n.tr("Delete")
40 // TODO: temporary
41- iconSource: "/usr/share/icons/Humanity/actions/48/edit-delete.svg"
42+ iconSource: "image://theme/edit-delete"
43 onTriggered: {
44 print(text)
45 PopupUtils.open(confirmSingleDeleteDialog, actionSelectionPopover.caller,
46@@ -610,7 +610,7 @@
47 Action {
48 text: i18n.tr("Rename")
49 // TODO: temporary
50- iconSource: "/usr/share/icons/Humanity/actions/48/rotate.svg"
51+ iconSource: "image://theme/rotate"
52 onTriggered: {
53 print(text)
54 PopupUtils.open(confirmRenameDialog, actionSelectionPopover.caller,
55@@ -835,45 +835,45 @@
56 // files will need an icon.
57
58 function fileIcon(file, model) {
59- var iconPath = model ? "/usr/share/icons/Humanity/mimes/48/empty.svg" :
60- "/usr/share/icons/Humanity/places/48/folder.svg"
61+ var iconPath = model ? "empty" :
62+ "folder"
63
64 if (model && model.isSmbWorkgroup) {
65- iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
66+ iconPath = "network_local"
67 } else if (model && model.isHost) {
68- iconPath = "/usr/share/icons/Humanity/places/48/server.svg"
69+ iconPath = "server"
70 } else if (model && model.isBrowsable) {
71- iconPath = "/usr/share/icons/Humanity/places/48/folder.svg"
72+ iconPath = "folder"
73 } else if (file === userplaces.locationHome) {
74- iconPath = "../icons/folder-home.svg"
75+ iconPath = "folder-home"
76 } else if (file === i18n.tr("~/Desktop")) {
77- iconPath = "/usr/share/icons/Humanity/places/48/user-desktop.svg"
78+ iconPath = "user-desktop"
79 } else if (file === userplaces.locationDocuments) {
80- iconPath = "/usr/share/icons/Humanity/places/48/folder-documents.svg"
81+ iconPath = "folder-documents"
82 } else if (file === userplaces.locationDownloads) {
83- iconPath = "/usr/share/icons/Humanity/places/48/folder-downloads.svg"
84+ iconPath = "folder-downloads"
85 } else if (file === userplaces.locationMusic) {
86- iconPath = "/usr/share/icons/Humanity/places/48/folder-music.svg"
87+ iconPath = "folder-music"
88 } else if (file === userplaces.locationPictures) {
89- iconPath = "/usr/share/icons/Humanity/places/48/folder-pictures.svg"
90+ iconPath = "folder-pictures"
91 } else if (file === i18n.tr("~/Public")) {
92- iconPath = "/usr/share/icons/Humanity/places/48/folder-publicshare.svg"
93+ iconPath = "folder-publicshare"
94 } else if (file === i18n.tr("~/Programs")) {
95- iconPath = "/usr/share/icons/Humanity/places/48/folder-system.svg"
96+ iconPath = "folder-system"
97 } else if (file === i18n.tr("~/Templates")) {
98- iconPath = "/usr/share/icons/Humanity/places/48/folder-templates.svg"
99+ iconPath = "folder-templates"
100 } else if (file === userplaces.locationVideos) {
101- iconPath = "/usr/share/icons/Humanity/places/48/folder-videos.svg"
102+ iconPath = "folder-videos"
103 } else if (file === "/") {
104- iconPath = "/usr/share/icons/Humanity/devices/48/drive-harddisk.svg"
105+ iconPath = "drive-harddisk"
106 } else if (file === userplaces.locationSamba) {
107- iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
108+ iconPath = "network_local"
109 } else if (userplaces.isUserMountDirectory(file)) {
110 // In context of Ubuntu Touch this means SDCard currently.
111- iconPath = "/usr/share/icons/Humanity/devices/48/drive-removable-media.svg"
112+ iconPath = "drive-removable-media"
113 }
114
115- return Qt.resolvedUrl(iconPath)
116+ return "image://theme/%1".arg(iconPath)
117 }
118
119 function folderDisplayName(folder) {

Subscribers

People subscribed via source and target branches