← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03 into lp:ubuntu-filemanager-app with lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-02 as a prerequisite.

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

Requested reviews:
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03/+merge/270337

Improved icon chooser based on the model data

Added icon for remote places and hosts
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/samba-ui-03 into lp:ubuntu-filemanager-app.
=== modified file 'src/app/qml/components/FolderIconDelegate.qml'
--- src/app/qml/components/FolderIconDelegate.qml	2014-09-20 10:49:51 +0000
+++ src/app/qml/components/FolderIconDelegate.qml	2015-09-07 21:29:26 +0000
@@ -52,7 +52,7 @@
     property string text: fileName
     property string subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
 
-    property var icon: fileIcon(filePath, model.isDir)
+    property var icon:   fileIcon(filePath, model)
 
     Item {
         anchors {

=== modified file 'src/app/qml/components/FolderListDelegate.qml'
--- src/app/qml/components/FolderListDelegate.qml	2014-09-20 10:49:51 +0000
+++ src/app/qml/components/FolderListDelegate.qml	2015-09-07 21:29:26 +0000
@@ -30,9 +30,9 @@
     subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
 
     property string path: fileView.folder + '/' + model.fileName
-    iconSource: fileIcon(path, model.isDir)
+    iconSource: fileIcon(path, model)
 
-    progression: model.isDir
+    progression: model.isBrowsable
     iconFrame: false
 
     selected: model.isSelected

=== modified file 'src/app/qml/components/PlacesSidebar.qml'
--- src/app/qml/components/PlacesSidebar.qml	2015-01-01 20:43:56 +0000
+++ src/app/qml/components/PlacesSidebar.qml	2015-09-07 21:29:26 +0000
@@ -80,7 +80,7 @@
                     }
                 }
 
-                iconSource: model.icon || fileIcon(model.path, true)
+                iconSource: model.icon || fileIcon(model.path) //using only path, model is null
 
                 onClicked: {
                     goTo(model.path)

=== modified file 'src/app/qml/ui/FolderListPage.qml'
--- src/app/qml/ui/FolderListPage.qml	2015-08-28 10:37:28 +0000
+++ src/app/qml/ui/FolderListPage.qml	2015-09-07 21:29:26 +0000
@@ -771,12 +771,18 @@
     // to get "system wide" icons in Ubuntu Touch, or if we have to use
     // icons packaged into the application. Both folder and individual
     // files will need an icon.
-    // TODO: Remove isDir parameter and use new model functions
-    function fileIcon(file, isDir) {
-        var iconPath = isDir ? "/usr/share/icons/Humanity/places/48/folder.svg"
-                             : "/usr/share/icons/Humanity/mimes/48/empty.svg"
-
-        if (file === userplaces.locationHome) {
+
+    function fileIcon(file, model) {
+        var iconPath = model ? "/usr/share/icons/Humanity/mimes/48/empty.svg" :
+                               "/usr/share/icons/Humanity/places/48/folder.svg"
+
+        if (model && model.isSmbWorkgroup) {
+            iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
+        } else if (model && model.isHost) {
+            iconPath = "/usr/share/icons/Humanity/places/48/server.svg"
+        } else if (model && model.isBrowsable) {
+            iconPath = "/usr/share/icons/Humanity/places/48/folder.svg"
+        } else if (file === userplaces.locationHome) {
             iconPath = "../icons/folder-home.svg"
         } else if (file === i18n.tr("~/Desktop")) {
             iconPath = "/usr/share/icons/Humanity/places/48/user-desktop.svg"
@@ -798,7 +804,9 @@
             iconPath = "/usr/share/icons/Humanity/places/48/folder-videos.svg"
         } else if (file === "/") {
             iconPath = "/usr/share/icons/Humanity/devices/48/drive-harddisk.svg"
-        } else if (userplaces.isUserMountDirectory(file)) {
+        } else if (file === userplaces.locationSamba) {
+          iconPath = "/usr/share/icons/Humanity/places/48/network_local.svg"
+        }  else if (userplaces.isUserMountDirectory(file)) {
             // In context of Ubuntu Touch this means SDCard currently.
             iconPath = "/usr/share/icons/Humanity/devices/48/drive-removable-media.svg"
         }
@@ -811,6 +819,8 @@
             return i18n.tr("Home")
         } else if (folder === "/") {
             return i18n.tr("Device")
+        } else if (folder === userplaces.locationSamba) {
+            return i18n.tr("Network")
         } else {
             return basename(folder)
         }


Follow ups