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

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
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
Ubuntu File Manager Developers 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.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
575. By Renato Araujo Oliveira Filho

Limit the icon size used on Details page.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/qml/ui/FileDetailsPopover.qml'
--- src/app/qml/ui/FileDetailsPopover.qml 2016-04-06 14:51:26 +0000
+++ src/app/qml/ui/FileDetailsPopover.qml 2016-10-06 15:39:03 +0000
@@ -72,6 +72,10 @@
7272
73 // TODO: how to get proper icon?73 // TODO: how to get proper icon?
74 source: fileIcon(root.path, model.isDir)74 source: fileIcon(root.path, model.isDir)
75 sourceSize {
76 width: 48
77 height: 48
78 }
75 }79 }
7680
77 Label {81 Label {
7882
=== modified file 'src/app/qml/ui/FolderListPage.qml'
--- src/app/qml/ui/FolderListPage.qml 2016-07-25 12:19:21 +0000
+++ src/app/qml/ui/FolderListPage.qml 2016-10-06 15:39:03 +0000
@@ -574,7 +574,7 @@
574 Action {574 Action {
575 text: i18n.tr("Cut")575 text: i18n.tr("Cut")
576 // TODO: temporary576 // TODO: temporary
577 iconSource: "/usr/share/icons/Humanity/actions/48/edit-cut.svg"577 iconSource: "image://theme/edit-cut"
578 onTriggered: {578 onTriggered: {
579 console.log("Cut on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)579 console.log("Cut on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
580 pageModel.cutIndex(actionSelectionPopover.model.index)580 pageModel.cutIndex(actionSelectionPopover.model.index)
@@ -585,7 +585,7 @@
585 Action {585 Action {
586 text: i18n.tr("Copy")586 text: i18n.tr("Copy")
587 // TODO: temporary.587 // TODO: temporary.
588 iconSource: "/usr/share/icons/Humanity/actions/48/edit-copy.svg"588 iconSource: "image://theme/edit-copy"
589589
590 onTriggered: {590 onTriggered: {
591 console.log("Copy on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)591 console.log("Copy on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
@@ -597,7 +597,7 @@
597 Action {597 Action {
598 text: i18n.tr("Delete")598 text: i18n.tr("Delete")
599 // TODO: temporary599 // TODO: temporary
600 iconSource: "/usr/share/icons/Humanity/actions/48/edit-delete.svg"600 iconSource: "image://theme/edit-delete"
601 onTriggered: {601 onTriggered: {
602 print(text)602 print(text)
603 PopupUtils.open(confirmSingleDeleteDialog, actionSelectionPopover.caller,603 PopupUtils.open(confirmSingleDeleteDialog, actionSelectionPopover.caller,
@@ -610,7 +610,7 @@
610 Action {610 Action {
611 text: i18n.tr("Rename")611 text: i18n.tr("Rename")
612 // TODO: temporary612 // TODO: temporary
613 iconSource: "/usr/share/icons/Humanity/actions/48/rotate.svg"613 iconSource: "image://theme/rotate"
614 onTriggered: {614 onTriggered: {
615 print(text)615 print(text)
616 PopupUtils.open(confirmRenameDialog, actionSelectionPopover.caller,616 PopupUtils.open(confirmRenameDialog, actionSelectionPopover.caller,
@@ -835,45 +835,45 @@
835 // files will need an icon.835 // files will need an icon.
836836
837 function fileIcon(file, model) {837 function fileIcon(file, model) {
838 var iconPath = model ? "/usr/share/icons/Humanity/mimes/48/empty.svg" :838 var iconPath = model ? "empty" :
839 "/usr/share/icons/Humanity/places/48/folder.svg"839 "folder"
840840
841 if (model && model.isSmbWorkgroup) {841 if (model && model.isSmbWorkgroup) {
842 iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"842 iconPath = "network_local"
843 } else if (model && model.isHost) {843 } else if (model && model.isHost) {
844 iconPath = "/usr/share/icons/Humanity/places/48/server.svg"844 iconPath = "server"
845 } else if (model && model.isBrowsable) {845 } else if (model && model.isBrowsable) {
846 iconPath = "/usr/share/icons/Humanity/places/48/folder.svg"846 iconPath = "folder"
847 } else if (file === userplaces.locationHome) {847 } else if (file === userplaces.locationHome) {
848 iconPath = "../icons/folder-home.svg"848 iconPath = "folder-home"
849 } else if (file === i18n.tr("~/Desktop")) {849 } else if (file === i18n.tr("~/Desktop")) {
850 iconPath = "/usr/share/icons/Humanity/places/48/user-desktop.svg"850 iconPath = "user-desktop"
851 } else if (file === userplaces.locationDocuments) {851 } else if (file === userplaces.locationDocuments) {
852 iconPath = "/usr/share/icons/Humanity/places/48/folder-documents.svg"852 iconPath = "folder-documents"
853 } else if (file === userplaces.locationDownloads) {853 } else if (file === userplaces.locationDownloads) {
854 iconPath = "/usr/share/icons/Humanity/places/48/folder-downloads.svg"854 iconPath = "folder-downloads"
855 } else if (file === userplaces.locationMusic) {855 } else if (file === userplaces.locationMusic) {
856 iconPath = "/usr/share/icons/Humanity/places/48/folder-music.svg"856 iconPath = "folder-music"
857 } else if (file === userplaces.locationPictures) {857 } else if (file === userplaces.locationPictures) {
858 iconPath = "/usr/share/icons/Humanity/places/48/folder-pictures.svg"858 iconPath = "folder-pictures"
859 } else if (file === i18n.tr("~/Public")) {859 } else if (file === i18n.tr("~/Public")) {
860 iconPath = "/usr/share/icons/Humanity/places/48/folder-publicshare.svg"860 iconPath = "folder-publicshare"
861 } else if (file === i18n.tr("~/Programs")) {861 } else if (file === i18n.tr("~/Programs")) {
862 iconPath = "/usr/share/icons/Humanity/places/48/folder-system.svg"862 iconPath = "folder-system"
863 } else if (file === i18n.tr("~/Templates")) {863 } else if (file === i18n.tr("~/Templates")) {
864 iconPath = "/usr/share/icons/Humanity/places/48/folder-templates.svg"864 iconPath = "folder-templates"
865 } else if (file === userplaces.locationVideos) {865 } else if (file === userplaces.locationVideos) {
866 iconPath = "/usr/share/icons/Humanity/places/48/folder-videos.svg"866 iconPath = "folder-videos"
867 } else if (file === "/") {867 } else if (file === "/") {
868 iconPath = "/usr/share/icons/Humanity/devices/48/drive-harddisk.svg"868 iconPath = "drive-harddisk"
869 } else if (file === userplaces.locationSamba) {869 } else if (file === userplaces.locationSamba) {
870 iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"870 iconPath = "network_local"
871 } else if (userplaces.isUserMountDirectory(file)) {871 } else if (userplaces.isUserMountDirectory(file)) {
872 // In context of Ubuntu Touch this means SDCard currently.872 // In context of Ubuntu Touch this means SDCard currently.
873 iconPath = "/usr/share/icons/Humanity/devices/48/drive-removable-media.svg"873 iconPath = "drive-removable-media"
874 }874 }
875875
876 return Qt.resolvedUrl(iconPath)876 return "image://theme/%1".arg(iconPath)
877 }877 }
878878
879 function folderDisplayName(folder) {879 function folderDisplayName(folder) {

Subscribers

People subscribed via source and target branches