← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~carlos-mazieri/ubuntu-filemanager-app/bug-1436186 into lp:ubuntu-filemanager-app

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/bug-1436186 into lp:ubuntu-filemanager-app.

Commit message:
It fixes the bug #1436186 to allow browsing directories like AA:BB::CC

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

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/bug-1436186/+merge/263201

It fixes the bug #1436186 to allow browsing directories like AA:BB::CC
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/bug-1436186 into lp:ubuntu-filemanager-app.
=== modified file 'src/plugin/folderlistmodel/diriteminfo.cpp'
--- src/plugin/folderlistmodel/diriteminfo.cpp	2015-03-16 21:39:37 +0000
+++ src/plugin/folderlistmodel/diriteminfo.cpp	2015-06-28 18:11:30 +0000
@@ -20,6 +20,7 @@
  */
 
 #include "diriteminfo.h"
+#include "locationurl.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -537,7 +538,7 @@
     QString ret;
     if (firstSlashIndex == -1)
     {
-        firstSlashIndex = url.indexOf(QLatin1String(":/"));
+        firstSlashIndex = url.indexOf(LocationUrl::UrlIndicator);
         if (firstSlashIndex != -1)
         {
             ++firstSlashIndex;

=== modified file 'src/plugin/folderlistmodel/locationsfactory.cpp'
--- src/plugin/folderlistmodel/locationsfactory.cpp	2015-06-03 11:54:36 +0000
+++ src/plugin/folderlistmodel/locationsfactory.cpp	2015-06-28 18:11:30 +0000
@@ -85,7 +85,7 @@
     int index = -1;
     int type  = -1;
     Location * location = 0;   
-    if ( (index = uPath.indexOf(QChar(':'))) != -1 )
+    if ( (index = uPath.indexOf(LocationUrl::UrlIndicator)) != -1 )
     {
 #if defined(Q_OS_WIN)
 #else

=== modified file 'src/plugin/folderlistmodel/locationurl.cpp'
--- src/plugin/folderlistmodel/locationurl.cpp	2015-03-01 19:02:31 +0000
+++ src/plugin/folderlistmodel/locationurl.cpp	2015-06-28 18:11:30 +0000
@@ -21,6 +21,8 @@
 
 #include "locationurl.h"
 
+const QString LocationUrl::UrlIndicator("://");
+
 const QString LocationUrl::TrashRootURL("trash:///");
 const QString LocationUrl::DiskRootURL("file:///");
 const QString LocationUrl::SmbURL("smb://");

=== modified file 'src/plugin/folderlistmodel/locationurl.h'
--- src/plugin/folderlistmodel/locationurl.h	2015-03-01 19:02:31 +0000
+++ src/plugin/folderlistmodel/locationurl.h	2015-06-28 18:11:30 +0000
@@ -27,6 +27,7 @@
 class LocationUrl
 {
 public:
+    static const   QString UrlIndicator;
     static const   QString DiskRootURL;
     static const   QString TrashRootURL;
     static const   QString SmbURL;

=== modified file 'src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp'
--- src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp	2015-06-20 17:39:20 +0000
+++ src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp	2015-06-28 18:11:30 +0000
@@ -2517,16 +2517,14 @@
 
     QString validTrashURL(LocationUrl::TrashRootURL);
 
-   //Due to current File Manager UI typing method both: "file:" and "trash:" are supported
-   // location = factoryLocations.setNewPath("trash:");
-   // QVERIFY(location == 0);
-
+#if 0 // "sheme:/"  (single slash) is no longer supported
     location = factoryLocations.setNewPath("trash:/");
     QVERIFY(location);
     QVERIFY(location->type() == LocationsFactory::TrashDisk);
     QCOMPARE(location->info()->absoluteFilePath(),   validTrashURL);
     QCOMPARE(location->urlPath(), validTrashURL);
     QCOMPARE(location->isRoot(), true);
+#endif
 
     location = factoryLocations.setNewPath("trash://");
     QVERIFY(location);
@@ -2549,9 +2547,11 @@
     QCOMPARE(location->urlPath(), validTrashURL);
     QCOMPARE(location->isRoot(), true);
 
+#if 0  // "sheme:/"  (single slash) is no longer supported
     QString myDir("___myDir_must_NOT_EXIST___");
     location = factoryLocations.setNewPath(QString("trash:/") + myDir);
     QVERIFY(location == 0);
+#endif
 
     location = factoryLocations.setNewPath("file://////");
     QVERIFY(location);


Follow ups