Merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-10 into lp:ubuntu-filemanager-app

Proposed by Carlos Jose Mazieri on 2015-07-19
Status: Merged
Approved by: Arto Jalkanen on 2015-08-07
Approved revision: 441
Merged at revision: 446
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-10
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09
Diff against target: 32 lines (+14/-0)
2 files modified
src/plugin/folderlistmodel/trash/trashlocation.cpp (+13/-0)
src/plugin/folderlistmodel/trash/trashlocation.h (+1/-0)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-10
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-07-19 Approve on 2015-08-07
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-07-19
Review via email: mp+265209@code.launchpad.net

Commit message

provided TrashLocation::urlBelongsToLocation()

Description of the change

TrashLocation::urlBelongsToLocation() should have been present in the previous MPs.

To post a comment you must log in.
Arto Jalkanen (ajalkane) wrote :

Same note as in previous MP, hard-coded length of start of trash url would be best be a constant or logic in LocationUrl

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/trash/trashlocation.cpp'
2--- src/plugin/folderlistmodel/trash/trashlocation.cpp 2015-03-01 15:32:42 +0000
3+++ src/plugin/folderlistmodel/trash/trashlocation.cpp 2015-07-19 15:32:02 +0000
4@@ -314,3 +314,16 @@
5 }
6 return new TrashListWorker(trashDir, urlPath, filter);
7 }
8+
9+
10+QString TrashLocation::urlBelongsToLocation(const QString &urlPath, int indexOfColonAndSlashe)
11+{
12+ QString ret;
13+#if defined(Q_OS_UNIX)
14+ if (urlPath.startsWith(LocationUrl::TrashRootURL.midRef(0,6)))
15+ {
16+ ret = LocationUrl::TrashRootURL + DirItemInfo::removeExtraSlashes(urlPath, indexOfColonAndSlashe+1);
17+ }
18+#endif
19+ return ret;
20+}
21
22=== modified file 'src/plugin/folderlistmodel/trash/trashlocation.h'
23--- src/plugin/folderlistmodel/trash/trashlocation.h 2015-03-01 15:32:42 +0000
24+++ src/plugin/folderlistmodel/trash/trashlocation.h 2015-07-19 15:32:02 +0000
25@@ -49,6 +49,7 @@
26 virtual DirListWorker * newListWorker(const QString &urlPath,
27 QDir::Filter filter,
28 const bool isRecursive);
29+ virtual QString urlBelongsToLocation(const QString& urlPath, int indexOfColonAndSlashe);
30
31 /*!
32 * \brief getMovePairPaths() Get: original path and destination trash path

Subscribers

People subscribed via source and target branches