Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-02 into lp:ubuntu-filemanager-app
- samba-actions-02
- Merge into trunk
Proposed by
Carlos Jose Mazieri
Status: | Merged |
---|---|
Approved by: | Arto Jalkanen |
Approved revision: | 432 |
Merged at revision: | 437 |
Proposed branch: | lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-02 |
Merge into: | lp:ubuntu-filemanager-app |
Prerequisite: | lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-01 |
Diff against target: |
413 lines (+118/-52) 7 files modified
src/plugin/folderlistmodel/diriteminfo.cpp (+3/-3) src/plugin/folderlistmodel/dirmodel.cpp (+9/-9) src/plugin/folderlistmodel/location.cpp (+24/-1) src/plugin/folderlistmodel/location.h (+41/-0) src/plugin/folderlistmodel/locationsfactory.cpp (+21/-15) src/plugin/folderlistmodel/locationsfactory.h (+12/-16) src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp (+8/-8) |
To merge this branch: | bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-02 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Arto Jalkanen | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+265193@code.launchpad.net |
Commit message
Enumerator Locations moved from class LocationsFactory to class Location
Created Location:
Created Location:
Description of the change
Location class is improved:
* Some methods from FileSystemAction will migrate to Location class
* Added methods to identify if a Location object is Local/Remote
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-06-28 18:07:28 +0000 | |||
3 | +++ src/plugin/folderlistmodel/diriteminfo.cpp 2015-07-18 21:23:48 +0000 | |||
4 | @@ -457,15 +457,15 @@ | |||
5 | 457 | //owner permissions | 457 | //owner permissions |
6 | 458 | if (statBuffer.st_mode & S_IRUSR) | 458 | if (statBuffer.st_mode & S_IRUSR) |
7 | 459 | { | 459 | { |
9 | 460 | readPermission |= QFile::ReadOwner; | 460 | readPermission |= QFile::ReadOwner | QFile::ReadUser; |
10 | 461 | } | 461 | } |
11 | 462 | if (statBuffer.st_mode & S_IWUSR) | 462 | if (statBuffer.st_mode & S_IWUSR) |
12 | 463 | { | 463 | { |
14 | 464 | writePermission |= QFile::WriteOwner; | 464 | writePermission |= QFile::WriteOwner | QFile::WriteUser; |
15 | 465 | } | 465 | } |
16 | 466 | if (statBuffer.st_mode & S_IXUSR) | 466 | if (statBuffer.st_mode & S_IXUSR) |
17 | 467 | { | 467 | { |
19 | 468 | execPermission |= QFile::ExeOwner; | 468 | execPermission |= QFile::ExeOwner | QFile::ExeUser; |
20 | 469 | } | 469 | } |
21 | 470 | //group permissions | 470 | //group permissions |
22 | 471 | if (statBuffer.st_mode & S_IRGRP) | 471 | if (statBuffer.st_mode & S_IRGRP) |
23 | 472 | 472 | ||
24 | === modified file 'src/plugin/folderlistmodel/dirmodel.cpp' | |||
25 | --- src/plugin/folderlistmodel/dirmodel.cpp 2015-07-18 21:23:48 +0000 | |||
26 | +++ src/plugin/folderlistmodel/dirmodel.cpp 2015-07-18 21:23:48 +0000 | |||
27 | @@ -76,7 +76,7 @@ | |||
28 | 76 | 76 | ||
29 | 77 | #define IS_FILE_MANAGER_IDLE() (!mAwaitingResults) | 77 | #define IS_FILE_MANAGER_IDLE() (!mAwaitingResults) |
30 | 78 | 78 | ||
32 | 79 | #define IS_BROWSING_TRASH_ROOTDIR() (mCurLocation && mCurLocation->type() == LocationsFactory::TrashDisk && mCurLocation->isRoot()) | 79 | #define IS_BROWSING_TRASH_ROOTDIR() (mCurLocation && mCurLocation->isTrashDisk() && mCurLocation->isRoot()) |
33 | 80 | 80 | ||
34 | 81 | namespace { | 81 | namespace { |
35 | 82 | QHash<QByteArray, int> roleMapping; | 82 | QHash<QByteArray, int> roleMapping; |
36 | @@ -412,7 +412,7 @@ | |||
37 | 412 | return fi.isBrowsable(); | 412 | return fi.isBrowsable(); |
38 | 413 | case IsSharingAllowedRole: | 413 | case IsSharingAllowedRole: |
39 | 414 | return fi.isDir() && !fi.isSymLink() && !fi.isSharedDir() | 414 | return fi.isDir() && !fi.isSymLink() && !fi.isSharedDir() |
41 | 415 | && mCurLocation->type() == LocationsFactory::LocalDisk | 415 | && mCurLocation->isLocalDisk() |
42 | 416 | && fi.isWritable() && fi.isExecutable() && fi.isReadable(); | 416 | && fi.isWritable() && fi.isExecutable() && fi.isReadable(); |
43 | 417 | case IsSharedDirRole: | 417 | case IsSharedDirRole: |
44 | 418 | return fi.isSharedDir(); | 418 | return fi.isSharedDir(); |
45 | @@ -591,7 +591,7 @@ | |||
46 | 591 | } | 591 | } |
47 | 592 | 592 | ||
48 | 593 | //if current location is Trash only in the root is allowed to remove Items | 593 | //if current location is Trash only in the root is allowed to remove Items |
50 | 594 | if (mCurLocation->type() == LocationsFactory::TrashDisk) | 594 | if (mCurLocation->isTrashDisk()) |
51 | 595 | { | 595 | { |
52 | 596 | if (IS_BROWSING_TRASH_ROOTDIR()) | 596 | if (IS_BROWSING_TRASH_ROOTDIR()) |
53 | 597 | { | 597 | { |
54 | @@ -788,8 +788,8 @@ | |||
55 | 788 | } | 788 | } |
56 | 789 | ExternalFSWatcher * DirModel::getExternalFSWatcher() const | 789 | ExternalFSWatcher * DirModel::getExternalFSWatcher() const |
57 | 790 | { | 790 | { |
60 | 791 | const Location *l = mLocationFactory->availableLocations().at(LocationsFactory::LocalDisk); | 791 | Location *l = mLocationFactory->getDiskLocation(); |
61 | 792 | const DiskLocation *disk = static_cast<const DiskLocation*> (l); | 792 | DiskLocation *disk = static_cast<DiskLocation*> (l); |
62 | 793 | return disk->getExternalFSWatcher(); | 793 | return disk->getExternalFSWatcher(); |
63 | 794 | } | 794 | } |
64 | 795 | #endif | 795 | #endif |
65 | @@ -885,8 +885,8 @@ | |||
66 | 885 | 885 | ||
67 | 886 | void DirModel::paste() | 886 | void DirModel::paste() |
68 | 887 | { | 887 | { |
71 | 888 | // Restrict pasting if in restricted directory | 888 | // Restrict pasting if in restricted directory when pasting on a local file system |
72 | 889 | if (!allowAccess(mCurrentDir)) { | 889 | if (!mCurLocation->isRemote() && !allowAccess(mCurrentDir)) { |
73 | 890 | qDebug() << Q_FUNC_INFO << "access not allowed, pasting not done" << mCurrentDir; | 890 | qDebug() << Q_FUNC_INFO << "access not allowed, pasting not done" << mCurrentDir; |
74 | 891 | return; | 891 | return; |
75 | 892 | } | 892 | } |
76 | @@ -1682,10 +1682,10 @@ | |||
77 | 1682 | 1682 | ||
78 | 1683 | void DirModel:: moveIndexesToTrash(const QList<int>& items) | 1683 | void DirModel:: moveIndexesToTrash(const QList<int>& items) |
79 | 1684 | { | 1684 | { |
81 | 1685 | if (mCurLocation->type() == LocationsFactory::LocalDisk) | 1685 | if (mCurLocation->isLocalDisk()) |
82 | 1686 | { | 1686 | { |
83 | 1687 | const TrashLocation *trashLocation = static_cast<const TrashLocation*> | 1687 | const TrashLocation *trashLocation = static_cast<const TrashLocation*> |
85 | 1688 | (mLocationFactory->getLocation(LocationsFactory::TrashDisk)); | 1688 | (mLocationFactory->getTrashLocation()); |
86 | 1689 | ActionPathList itemsAndTrashPath; | 1689 | ActionPathList itemsAndTrashPath; |
87 | 1690 | int index = 0; | 1690 | int index = 0; |
88 | 1691 | for (int counter=0; counter < items.count(); ++counter) | 1691 | for (int counter=0; counter < items.count(); ++counter) |
89 | 1692 | 1692 | ||
90 | === modified file 'src/plugin/folderlistmodel/location.cpp' | |||
91 | --- src/plugin/folderlistmodel/location.cpp 2015-03-01 19:02:31 +0000 | |||
92 | +++ src/plugin/folderlistmodel/location.cpp 2015-07-18 21:23:48 +0000 | |||
93 | @@ -305,4 +305,27 @@ | |||
94 | 305 | } | 305 | } |
95 | 306 | } | 306 | } |
96 | 307 | 307 | ||
98 | 308 | 308 | /* | |
99 | 309 | * Each Location should have its implementation if it is possible | ||
100 | 310 | */ | ||
101 | 311 | bool Location::isThereDiskSpace(const QString &pathname, qint64 requiredSize) | ||
102 | 312 | { | ||
103 | 313 | Q_UNUSED(pathname); | ||
104 | 314 | Q_UNUSED(requiredSize); | ||
105 | 315 | return true; | ||
106 | 316 | } | ||
107 | 317 | |||
108 | 318 | |||
109 | 319 | /*! | ||
110 | 320 | * \brief Location::currentInfo() | ||
111 | 321 | * \return the updated information about the current path | ||
112 | 322 | */ | ||
113 | 323 | const DirItemInfo *Location::currentInfo() | ||
114 | 324 | { | ||
115 | 325 | if (m_info == 0) | ||
116 | 326 | { | ||
117 | 327 | m_info = new DirItemInfo(); | ||
118 | 328 | } | ||
119 | 329 | refreshInfo(); //update information | ||
120 | 330 | return m_info; | ||
121 | 331 | } | ||
122 | 309 | 332 | ||
123 | === modified file 'src/plugin/folderlistmodel/location.h' | |||
124 | --- src/plugin/folderlistmodel/location.h 2015-03-01 15:32:42 +0000 | |||
125 | +++ src/plugin/folderlistmodel/location.h 2015-07-18 21:23:48 +0000 | |||
126 | @@ -47,6 +47,24 @@ | |||
127 | 47 | { | 47 | { |
128 | 48 | Q_OBJECT | 48 | Q_OBJECT |
129 | 49 | public: | 49 | public: |
130 | 50 | |||
131 | 51 | Q_ENUMS(Locations) | ||
132 | 52 | /*! | ||
133 | 53 | * \brief The Locations enum defines which Locations are supported | ||
134 | 54 | * | ||
135 | 55 | * \note Items also work as indexes for \a m_locations, they must be 0..(n-1) | ||
136 | 56 | */ | ||
137 | 57 | enum Locations | ||
138 | 58 | { | ||
139 | 59 | LocalDisk=0, //<! any mounted file system | ||
140 | 60 | TrashDisk, //<! special trash location in the disk | ||
141 | 61 | NetSambaShare //<! SAMBA or CIFS shares | ||
142 | 62 | #if 0 | ||
143 | 63 | NetFishShare //<! FISH protocol over ssh that provides file sharing | ||
144 | 64 | #endif | ||
145 | 65 | }; | ||
146 | 66 | |||
147 | 67 | public: | ||
148 | 50 | virtual ~Location(); | 68 | virtual ~Location(); |
149 | 51 | protected: | 69 | protected: |
150 | 52 | explicit Location( int type, QObject *parent=0); | 70 | explicit Location( int type, QObject *parent=0); |
151 | @@ -93,6 +111,21 @@ | |||
152 | 93 | 111 | ||
153 | 94 | public: | 112 | public: |
154 | 95 | /*! | 113 | /*! |
155 | 114 | * \brief isThereDiskSpace() Check if the filesystem has enough space to put a file with size \a requiredSize | ||
156 | 115 | * | ||
157 | 116 | * | ||
158 | 117 | * \param pathname is the full pathname of the new file that is going to be created | ||
159 | 118 | * | ||
160 | 119 | * \param requiredSize the size required | ||
161 | 120 | * | ||
162 | 121 | * | ||
163 | 122 | * \note For remote locations if not is possible to get this value this function MUST return true | ||
164 | 123 | * | ||
165 | 124 | * The default implementation just returns true and let the copy fail if there is enough space | ||
166 | 125 | */ | ||
167 | 126 | virtual bool isThereDiskSpace(const QString& pathname, qint64 requiredSize); | ||
168 | 127 | |||
169 | 128 | /*! | ||
170 | 96 | * \brief fetchItems() gets the content of the Location | 129 | * \brief fetchItems() gets the content of the Location |
171 | 97 | * | 130 | * |
172 | 98 | * \param dirFilter current Filter | 131 | * \param dirFilter current Filter |
173 | @@ -131,6 +164,13 @@ | |||
174 | 131 | */ | 164 | */ |
175 | 132 | virtual DirItemInfo * validateUrlPath(const QString& urlPath); | 165 | virtual DirItemInfo * validateUrlPath(const QString& urlPath); |
176 | 133 | 166 | ||
177 | 167 | /*! | ||
178 | 168 | * \brief isRemote() It must return TRUE when type() is greater than Location::TrashDisk | ||
179 | 169 | * \return | ||
180 | 170 | */ | ||
181 | 171 | inline bool isRemote() const { return m_type > TrashDisk; } | ||
182 | 172 | inline bool isLocalDisk() const { return m_type == LocalDisk;} | ||
183 | 173 | inline bool isTrashDisk() const { return m_type == TrashDisk; } | ||
184 | 134 | 174 | ||
185 | 135 | public: //virtual | 175 | public: //virtual |
186 | 136 | virtual void fetchExternalChanges(const QString& urlPath, | 176 | virtual void fetchExternalChanges(const QString& urlPath, |
187 | @@ -153,6 +193,7 @@ | |||
188 | 153 | 193 | ||
189 | 154 | inline const DirItemInfo* info() const { return m_info; } | 194 | inline const DirItemInfo* info() const { return m_info; } |
190 | 155 | inline int type() const { return m_type; } | 195 | inline int type() const { return m_type; } |
191 | 196 | const DirItemInfo* currentInfo(); //updated information about the current path | ||
192 | 156 | 197 | ||
193 | 157 | protected: | 198 | protected: |
194 | 158 | DirItemInfo * m_info; | 199 | DirItemInfo * m_info; |
195 | 159 | 200 | ||
196 | === modified file 'src/plugin/folderlistmodel/locationsfactory.cpp' | |||
197 | --- src/plugin/folderlistmodel/locationsfactory.cpp 2015-06-28 18:07:28 +0000 | |||
198 | +++ src/plugin/folderlistmodel/locationsfactory.cpp 2015-07-18 21:23:48 +0000 | |||
199 | @@ -50,16 +50,9 @@ | |||
200 | 50 | , m_authDataStore(NetAuthenticationDataList::getInstance(this)) | 50 | , m_authDataStore(NetAuthenticationDataList::getInstance(this)) |
201 | 51 | , m_lastUrlNeedsAuthentication(false) | 51 | , m_lastUrlNeedsAuthentication(false) |
202 | 52 | { | 52 | { |
213 | 53 | m_locations.append(new DiskLocation(LocalDisk)); | 53 | addLocation(new DiskLocation(Location::LocalDisk)); |
214 | 54 | m_locations.append(new TrashLocation(TrashDisk)); | 54 | addLocation(new TrashLocation(Location::TrashDisk)); |
215 | 55 | SmbLocation * smblocation = new SmbLocation(NetSambaShare); | 55 | addLocation(new SmbLocation(Location::NetSambaShare)); |
206 | 56 | m_locations.append(smblocation); | ||
207 | 57 | |||
208 | 58 | // Qt::DirectConnection is used here | ||
209 | 59 | // it allows lastUrlNeedsAuthencation() to have the right flag | ||
210 | 60 | connect(smblocation, SIGNAL(needsAuthentication(QString,QString)), | ||
211 | 61 | this, SLOT(onUrlNeedsAuthentication(QString,QString)), | ||
212 | 62 | Qt::DirectConnection); | ||
216 | 63 | } | 56 | } |
217 | 64 | 57 | ||
218 | 65 | LocationsFactory::~LocationsFactory() | 58 | LocationsFactory::~LocationsFactory() |
219 | @@ -92,7 +85,7 @@ | |||
220 | 92 | #if defined(Q_OS_UNIX) | 85 | #if defined(Q_OS_UNIX) |
221 | 93 | if (uPath.startsWith(LocationUrl::TrashRootURL.midRef(0,6))) | 86 | if (uPath.startsWith(LocationUrl::TrashRootURL.midRef(0,6))) |
222 | 94 | { | 87 | { |
224 | 95 | type = TrashDisk; | 88 | type = Location::TrashDisk; |
225 | 96 | m_tmpPath = LocationUrl::TrashRootURL + DirItemInfo::removeExtraSlashes(uPath, index+1); | 89 | m_tmpPath = LocationUrl::TrashRootURL + DirItemInfo::removeExtraSlashes(uPath, index+1); |
226 | 97 | } | 90 | } |
227 | 98 | else | 91 | else |
228 | @@ -100,7 +93,7 @@ | |||
229 | 100 | #endif | 93 | #endif |
230 | 101 | if (uPath.startsWith(LocationUrl::DiskRootURL.midRef(0,5))) | 94 | if (uPath.startsWith(LocationUrl::DiskRootURL.midRef(0,5))) |
231 | 102 | { | 95 | { |
233 | 103 | type = LocalDisk; | 96 | type = Location::LocalDisk; |
234 | 104 | m_tmpPath = QDir::rootPath() + DirItemInfo::removeExtraSlashes(uPath, index+1); | 97 | m_tmpPath = QDir::rootPath() + DirItemInfo::removeExtraSlashes(uPath, index+1); |
235 | 105 | } | 98 | } |
236 | 106 | else | 99 | else |
237 | @@ -108,14 +101,14 @@ | |||
238 | 108 | uPath.startsWith(LocationUrl::CifsURL.midRef(0,5)) | 101 | uPath.startsWith(LocationUrl::CifsURL.midRef(0,5)) |
239 | 109 | ) | 102 | ) |
240 | 110 | { | 103 | { |
242 | 111 | type = NetSambaShare; | 104 | type = Location::NetSambaShare; |
243 | 112 | m_tmpPath = LocationUrl::SmbURL + DirItemInfo::removeExtraSlashes(uPath, index+1); | 105 | m_tmpPath = LocationUrl::SmbURL + DirItemInfo::removeExtraSlashes(uPath, index+1); |
244 | 113 | } | 106 | } |
245 | 114 | } | 107 | } |
246 | 115 | else | 108 | else |
247 | 116 | { | 109 | { |
248 | 117 | m_tmpPath = DirItemInfo::removeExtraSlashes(uPath, -1); | 110 | m_tmpPath = DirItemInfo::removeExtraSlashes(uPath, -1); |
250 | 118 | type = LocalDisk; | 111 | type = Location::LocalDisk; |
251 | 119 | if (!m_tmpPath.startsWith(QDir::rootPath()) && m_curLoc) | 112 | if (!m_tmpPath.startsWith(QDir::rootPath()) && m_curLoc) |
252 | 120 | { | 113 | { |
253 | 121 | //it can be any, check current location | 114 | //it can be any, check current location |
254 | @@ -127,7 +120,7 @@ | |||
255 | 127 | location = m_locations.at(type); | 120 | location = m_locations.at(type); |
256 | 128 | } | 121 | } |
257 | 129 | #if DEBUG_MESSAGES | 122 | #if DEBUG_MESSAGES |
259 | 130 | qDebug() << Q_FUNC_INFO << "input path:" << uPath << "location result:" << location; | 123 | qDebug() << Q_FUNC_INFO << "input path:" << uPath << "location:" << location << "type:" << type; |
260 | 131 | #endif | 124 | #endif |
261 | 132 | return location; | 125 | return location; |
262 | 133 | } | 126 | } |
263 | @@ -246,3 +239,16 @@ | |||
264 | 246 | } | 239 | } |
265 | 247 | return item; | 240 | return item; |
266 | 248 | } | 241 | } |
267 | 242 | |||
268 | 243 | |||
269 | 244 | void LocationsFactory::addLocation(Location *location) | ||
270 | 245 | { | ||
271 | 246 | m_locations.append(location); | ||
272 | 247 | |||
273 | 248 | // Qt::DirectConnection is used here | ||
274 | 249 | // it allows lastUrlNeedsAuthencation() to have the right flag | ||
275 | 250 | connect(location, SIGNAL(needsAuthentication(QString,QString)), | ||
276 | 251 | this, SLOT(onUrlNeedsAuthentication(QString,QString)), | ||
277 | 252 | Qt::DirectConnection); | ||
278 | 253 | } | ||
279 | 254 | |||
280 | 249 | 255 | ||
281 | === modified file 'src/plugin/folderlistmodel/locationsfactory.h' | |||
282 | --- src/plugin/folderlistmodel/locationsfactory.h 2015-06-03 11:54:36 +0000 | |||
283 | +++ src/plugin/folderlistmodel/locationsfactory.h 2015-07-18 21:23:48 +0000 | |||
284 | @@ -22,11 +22,11 @@ | |||
285 | 22 | #ifndef LOCATIONSFACTORY_H | 22 | #ifndef LOCATIONSFACTORY_H |
286 | 23 | #define LOCATIONSFACTORY_H | 23 | #define LOCATIONSFACTORY_H |
287 | 24 | 24 | ||
288 | 25 | #include "location.h" | ||
289 | 26 | |||
290 | 25 | #include <QObject> | 27 | #include <QObject> |
291 | 26 | #include <QList> | 28 | #include <QList> |
292 | 27 | 29 | ||
293 | 28 | |||
294 | 29 | class Location; | ||
295 | 30 | class DirItemInfo; | 30 | class DirItemInfo; |
296 | 31 | class NetAuthenticationDataList; | 31 | class NetAuthenticationDataList; |
297 | 32 | class NetAuthenticationData; | 32 | class NetAuthenticationData; |
298 | @@ -57,19 +57,9 @@ | |||
299 | 57 | explicit LocationsFactory(QObject *parent = 0); | 57 | explicit LocationsFactory(QObject *parent = 0); |
300 | 58 | ~LocationsFactory(); | 58 | ~LocationsFactory(); |
301 | 59 | 59 | ||
315 | 60 | Q_ENUMS(Locations) | 60 | inline Location * getLocation(int index) const {return m_locations.at(index);} |
316 | 61 | enum Locations | 61 | inline Location * getDiskLocation() const { return getLocation(Location::LocalDisk); } |
317 | 62 | { | 62 | inline Location * getTrashLocation() const { return getLocation(Location::TrashDisk); } |
305 | 63 | LocalDisk, //<! any mounted file system | ||
306 | 64 | TrashDisk, //<! special trash location in the disk | ||
307 | 65 | NetSambaShare //<! SAMBA or CIFS shares | ||
308 | 66 | #if 0 | ||
309 | 67 | NetFishShare //<! FISH protocol over ssh that provides file sharing | ||
310 | 68 | #endif | ||
311 | 69 | }; | ||
312 | 70 | |||
313 | 71 | inline const Location * getLocation(Locations index) const {return m_locations.at(index);} | ||
314 | 72 | |||
318 | 73 | 63 | ||
319 | 74 | /*! | 64 | /*! |
320 | 75 | * \brief parse() Just parses (does not set/change the current location) according to \a urlPath | 65 | * \brief parse() Just parses (does not set/change the current location) according to \a urlPath |
321 | @@ -100,7 +90,7 @@ | |||
322 | 100 | * \brief location() | 90 | * \brief location() |
323 | 101 | * \return The current location | 91 | * \return The current location |
324 | 102 | */ | 92 | */ |
326 | 103 | Location * location() const { return m_curLoc; } | 93 | Location * currentLocation() const { return m_curLoc; } |
327 | 104 | 94 | ||
328 | 105 | /*! | 95 | /*! |
329 | 106 | * \brief availableLocations() | 96 | * \brief availableLocations() |
330 | @@ -155,6 +145,12 @@ | |||
331 | 155 | */ | 145 | */ |
332 | 156 | DirItemInfo *validateCurrentUrl(Location *location, const NetAuthenticationData&); | 146 | DirItemInfo *validateCurrentUrl(Location *location, const NetAuthenticationData&); |
333 | 157 | 147 | ||
334 | 148 | /*! | ||
335 | 149 | * \brief addLocation() just appends the location in the list \ref m_locations and connect signals | ||
336 | 150 | * \param location | ||
337 | 151 | */ | ||
338 | 152 | void addLocation(Location * location); | ||
339 | 153 | |||
340 | 158 | signals: | 154 | signals: |
341 | 159 | void locationChanged(const Location *old, const Location *current); | 155 | void locationChanged(const Location *old, const Location *current); |
342 | 160 | 156 | ||
343 | 161 | 157 | ||
344 | === modified file 'src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp' | |||
345 | --- src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp 2015-06-28 18:07:28 +0000 | |||
346 | +++ src/plugin/test_folderlistmodel/regression/tst_folderlistmodel.cpp 2015-07-18 21:23:48 +0000 | |||
347 | @@ -2520,7 +2520,7 @@ | |||
348 | 2520 | #if 0 // "sheme:/" (single slash) is no longer supported | 2520 | #if 0 // "sheme:/" (single slash) is no longer supported |
349 | 2521 | location = factoryLocations.setNewPath("trash:/"); | 2521 | location = factoryLocations.setNewPath("trash:/"); |
350 | 2522 | QVERIFY(location); | 2522 | QVERIFY(location); |
352 | 2523 | QVERIFY(location->type() == LocationsFactory::TrashDisk); | 2523 | QVERIFY(location->isTrashDisk()); |
353 | 2524 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); | 2524 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); |
354 | 2525 | QCOMPARE(location->urlPath(), validTrashURL); | 2525 | QCOMPARE(location->urlPath(), validTrashURL); |
355 | 2526 | QCOMPARE(location->isRoot(), true); | 2526 | QCOMPARE(location->isRoot(), true); |
356 | @@ -2528,21 +2528,21 @@ | |||
357 | 2528 | 2528 | ||
358 | 2529 | location = factoryLocations.setNewPath("trash://"); | 2529 | location = factoryLocations.setNewPath("trash://"); |
359 | 2530 | QVERIFY(location); | 2530 | QVERIFY(location); |
361 | 2531 | QVERIFY(location->type() == LocationsFactory::TrashDisk); | 2531 | QVERIFY(location->isTrashDisk()); |
362 | 2532 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); | 2532 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); |
363 | 2533 | QCOMPARE(location->urlPath(), validTrashURL); | 2533 | QCOMPARE(location->urlPath(), validTrashURL); |
364 | 2534 | QCOMPARE(location->isRoot(), true); | 2534 | QCOMPARE(location->isRoot(), true); |
365 | 2535 | 2535 | ||
366 | 2536 | location = factoryLocations.setNewPath("trash:///"); | 2536 | location = factoryLocations.setNewPath("trash:///"); |
367 | 2537 | QVERIFY(location); | 2537 | QVERIFY(location); |
369 | 2538 | QVERIFY(location->type() == LocationsFactory::TrashDisk); | 2538 | QVERIFY(location->isTrashDisk()); |
370 | 2539 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); | 2539 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); |
371 | 2540 | QCOMPARE(location->urlPath(), validTrashURL); | 2540 | QCOMPARE(location->urlPath(), validTrashURL); |
372 | 2541 | QCOMPARE(location->isRoot(), true); | 2541 | QCOMPARE(location->isRoot(), true); |
373 | 2542 | 2542 | ||
374 | 2543 | location = factoryLocations.setNewPath("trash://////"); | 2543 | location = factoryLocations.setNewPath("trash://////"); |
375 | 2544 | QVERIFY(location); | 2544 | QVERIFY(location); |
377 | 2545 | QVERIFY(location->type() == LocationsFactory::TrashDisk); | 2545 | QVERIFY(location->isTrashDisk()); |
378 | 2546 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); | 2546 | QCOMPARE(location->info()->absoluteFilePath(), validTrashURL); |
379 | 2547 | QCOMPARE(location->urlPath(), validTrashURL); | 2547 | QCOMPARE(location->urlPath(), validTrashURL); |
380 | 2548 | QCOMPARE(location->isRoot(), true); | 2548 | QCOMPARE(location->isRoot(), true); |
381 | @@ -2555,28 +2555,28 @@ | |||
382 | 2555 | 2555 | ||
383 | 2556 | location = factoryLocations.setNewPath("file://////"); | 2556 | location = factoryLocations.setNewPath("file://////"); |
384 | 2557 | QVERIFY(location); | 2557 | QVERIFY(location); |
386 | 2558 | QVERIFY(location->type() == LocationsFactory::LocalDisk); | 2558 | QVERIFY(location->isLocalDisk()); |
387 | 2559 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); | 2559 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); |
388 | 2560 | QCOMPARE(location->urlPath(), QDir::rootPath()); | 2560 | QCOMPARE(location->urlPath(), QDir::rootPath()); |
389 | 2561 | QCOMPARE(location->isRoot(), true); | 2561 | QCOMPARE(location->isRoot(), true); |
390 | 2562 | 2562 | ||
391 | 2563 | location = factoryLocations.setNewPath("/"); | 2563 | location = factoryLocations.setNewPath("/"); |
392 | 2564 | QVERIFY(location); | 2564 | QVERIFY(location); |
394 | 2565 | QVERIFY(location->type() == LocationsFactory::LocalDisk); | 2565 | QVERIFY(location->isLocalDisk()); |
395 | 2566 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); | 2566 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); |
396 | 2567 | QCOMPARE(location->urlPath(), QDir::rootPath()); | 2567 | QCOMPARE(location->urlPath(), QDir::rootPath()); |
397 | 2568 | QCOMPARE(location->isRoot(), true); | 2568 | QCOMPARE(location->isRoot(), true); |
398 | 2569 | 2569 | ||
399 | 2570 | location = factoryLocations.setNewPath("//"); | 2570 | location = factoryLocations.setNewPath("//"); |
400 | 2571 | QVERIFY(location); | 2571 | QVERIFY(location); |
402 | 2572 | QVERIFY(location->type() == LocationsFactory::LocalDisk); | 2572 | QVERIFY(location->isLocalDisk()); |
403 | 2573 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); | 2573 | QCOMPARE(location->info()->absoluteFilePath(), QDir::rootPath()); |
404 | 2574 | QCOMPARE(location->urlPath(), QDir::rootPath()); | 2574 | QCOMPARE(location->urlPath(), QDir::rootPath()); |
405 | 2575 | QCOMPARE(location->isRoot(), true); | 2575 | QCOMPARE(location->isRoot(), true); |
406 | 2576 | 2576 | ||
407 | 2577 | location = factoryLocations.setNewPath("//bin"); | 2577 | location = factoryLocations.setNewPath("//bin"); |
408 | 2578 | QVERIFY(location); | 2578 | QVERIFY(location); |
410 | 2579 | QVERIFY(location->type() == LocationsFactory::LocalDisk); | 2579 | QVERIFY(location->isLocalDisk()); |
411 | 2580 | QCOMPARE(location->info()->absoluteFilePath(), QLatin1String("/bin")); | 2580 | QCOMPARE(location->info()->absoluteFilePath(), QLatin1String("/bin")); |
412 | 2581 | QCOMPARE(location->urlPath(), QLatin1String("/bin")); | 2581 | QCOMPARE(location->urlPath(), QLatin1String("/bin")); |
413 | 2582 | QCOMPARE(location->isRoot(), false); | 2582 | QCOMPARE(location->isRoot(), false); |
PASSED: Continuous integration, rev:432 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 508/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 3092 91.189. 93.70:8080/ job/generic- mediumtests- utopic/ 3092/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- filemanager- app-utopic- amd64-ci/ 224 91.189. 93.70:8080/ job/ubuntu- filemanager- app-vivid- amd64-ci/ 130
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- filemanager- app-ci/ 508/rebuild
http://