← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info into lp:ubuntu-filemanager-app with lp:~carlos-mazieri/ubuntu-filemanager-app/samba-crash-fix as a prerequisite.

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

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

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info/+merge/273001

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
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/directory-browsing-info into lp:ubuntu-filemanager-app.
=== modified file 'src/app/qml/components/FolderIconDelegate.qml'
--- src/app/qml/components/FolderIconDelegate.qml	2015-09-06 00:11:02 +0000
+++ src/app/qml/components/FolderIconDelegate.qml	2015-10-01 00:11:58 +0000
@@ -49,8 +49,8 @@
     property string fileName: model.fileName
     property string filePath: fileView.folder + '/' + fileName
 
-    property string text: fileName
-    property string subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
+    property string text: fileName   
+    property string subText: itemDateAndSize(model)
 
     property var icon:   fileIcon(filePath, model)
 

=== modified file 'src/app/qml/components/FolderListDelegate.qml'
--- src/app/qml/components/FolderListDelegate.qml	2015-09-06 00:11:02 +0000
+++ src/app/qml/components/FolderListDelegate.qml	2015-10-01 00:11:58 +0000
@@ -27,7 +27,7 @@
     property string filePath: path
 
     text: model.fileName
-    subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
+    subText: itemDateAndSize(model)
 
     property string path: fileView.folder + '/' + model.fileName
     iconSource: fileIcon(path, model)

=== modified file 'src/app/qml/ui/FolderListPage.qml'
--- src/app/qml/ui/FolderListPage.qml	2015-09-20 20:28:26 +0000
+++ src/app/qml/ui/FolderListPage.qml	2015-10-01 00:11:58 +0000
@@ -774,6 +774,16 @@
         return pageModel.curPathIsWritable()
     }
 
+    function itemDateAndSize(model) {
+        var strDate = Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate);       
+        //local file systems always have date and size for both files and directories
+        //remote file systems may have not size for directories, it comes as "Unknown"
+        if (strDate) {
+            strDate += ", " + model.fileSize //show the size even it is "Unknown"
+        }
+        return strDate;
+    }
+
     // FIXME: hard coded path for icon, assumes Ubuntu desktop icon available.
     // Nemo mobile has icon provider. Have to figure out what's the proper way
     // to get "system wide" icons in Ubuntu Touch, or if we have to use

=== modified file 'src/plugin/folderlistmodel/dirmodel.cpp'
--- src/plugin/folderlistmodel/dirmodel.cpp	2015-09-20 20:44:29 +0000
+++ src/plugin/folderlistmodel/dirmodel.cpp	2015-10-01 00:11:58 +0000
@@ -370,7 +370,7 @@
                  }
                  //it is possible to browse network folders and get its
                  //number of items, but it may take longer
-                 return tr("unkown");
+                 return tr("Unknown");
              }
              return fileSize(fi.size());
         }


Follow ups