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

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
Approved revision: 425
Merged at revision: 426
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/bug-1436186
Merge into: lp:ubuntu-filemanager-app
Diff against target: 93 lines (+10/-6)
5 files modified
src/plugin/folderlistmodel/diriteminfo.cpp (+2/-1)
src/plugin/folderlistmodel/locationsfactory.cpp (+1/-1)
src/plugin/folderlistmodel/locationurl.cpp (+2/-0)
src/plugin/folderlistmodel/locationurl.h (+1/-0)
src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp (+4/-4)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/bug-1436186
Reviewer Review Type Date Requested Status
Arto Jalkanen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+263201@code.launchpad.net

Commit message

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

Description of the change

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

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arto Jalkanen (ajalkane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/folderlistmodel/diriteminfo.cpp'
2--- src/plugin/folderlistmodel/diriteminfo.cpp 2015-03-16 21:39:37 +0000
3+++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-06-28 18:11:30 +0000
4@@ -20,6 +20,7 @@
5 */
6
7 #include "diriteminfo.h"
8+#include "locationurl.h"
9 #include <sys/types.h>
10 #include <sys/stat.h>
11
12@@ -537,7 +538,7 @@
13 QString ret;
14 if (firstSlashIndex == -1)
15 {
16- firstSlashIndex = url.indexOf(QLatin1String(":/"));
17+ firstSlashIndex = url.indexOf(LocationUrl::UrlIndicator);
18 if (firstSlashIndex != -1)
19 {
20 ++firstSlashIndex;
21
22=== modified file 'src/plugin/folderlistmodel/locationsfactory.cpp'
23--- src/plugin/folderlistmodel/locationsfactory.cpp 2015-06-03 11:54:36 +0000
24+++ src/plugin/folderlistmodel/locationsfactory.cpp 2015-06-28 18:11:30 +0000
25@@ -85,7 +85,7 @@
26 int index = -1;
27 int type = -1;
28 Location * location = 0;
29- if ( (index = uPath.indexOf(QChar(':'))) != -1 )
30+ if ( (index = uPath.indexOf(LocationUrl::UrlIndicator)) != -1 )
31 {
32 #if defined(Q_OS_WIN)
33 #else
34
35=== modified file 'src/plugin/folderlistmodel/locationurl.cpp'
36--- src/plugin/folderlistmodel/locationurl.cpp 2015-03-01 19:02:31 +0000
37+++ src/plugin/folderlistmodel/locationurl.cpp 2015-06-28 18:11:30 +0000
38@@ -21,6 +21,8 @@
39
40 #include "locationurl.h"
41
42+const QString LocationUrl::UrlIndicator("://");
43+
44 const QString LocationUrl::TrashRootURL("trash:///");
45 const QString LocationUrl::DiskRootURL("file:///");
46 const QString LocationUrl::SmbURL("smb://");
47
48=== modified file 'src/plugin/folderlistmodel/locationurl.h'
49--- src/plugin/folderlistmodel/locationurl.h 2015-03-01 19:02:31 +0000
50+++ src/plugin/folderlistmodel/locationurl.h 2015-06-28 18:11:30 +0000
51@@ -27,6 +27,7 @@
52 class LocationUrl
53 {
54 public:
55+ static const QString UrlIndicator;
56 static const QString DiskRootURL;
57 static const QString TrashRootURL;
58 static const QString SmbURL;
59
60=== modified file 'src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp'
61--- src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp 2015-06-20 17:39:20 +0000
62+++ src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp 2015-06-28 18:11:30 +0000
63@@ -2517,16 +2517,14 @@
64
65 QString validTrashURL(LocationUrl::TrashRootURL);
66
67- //Due to current File Manager UI typing method both: "file:" and "trash:" are supported
68- // location = factoryLocations.setNewPath("trash:");
69- // QVERIFY(location == 0);
70-
71+#if 0 // "sheme:/" (single slash) is no longer supported
72 location = factoryLocations.setNewPath("trash:/");
73 QVERIFY(location);
74 QVERIFY(location->type() == LocationsFactory::TrashDisk);
75 QCOMPARE(location->info()->absoluteFilePath(), validTrashURL);
76 QCOMPARE(location->urlPath(), validTrashURL);
77 QCOMPARE(location->isRoot(), true);
78+#endif
79
80 location = factoryLocations.setNewPath("trash://");
81 QVERIFY(location);
82@@ -2549,9 +2547,11 @@
83 QCOMPARE(location->urlPath(), validTrashURL);
84 QCOMPARE(location->isRoot(), true);
85
86+#if 0 // "sheme:/" (single slash) is no longer supported
87 QString myDir("___myDir_must_NOT_EXIST___");
88 location = factoryLocations.setNewPath(QString("trash:/") + myDir);
89 QVERIFY(location == 0);
90+#endif
91
92 location = factoryLocations.setNewPath("file://////");
93 QVERIFY(location);

Subscribers

People subscribed via source and target branches