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

Proposed by Carlos Jose Mazieri on 2015-07-18
Status: Merged
Approved by: Arto Jalkanen on 2015-08-07
Approved revision: 440
Merged at revision: 445
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-08
Diff against target: 51 lines (+16/-6)
1 file modified
src/plugin/folderlistmodel/filesystemaction.cpp (+16/-6)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-07-18 Approve on 2015-08-07
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-07-19
Review via email: mp+265200@code.launchpad.net

Commit message

Actions are using LocationItemDirIterator instead of Qt QDirIterator object.

Description of the change

Actions are using LocationItemDirIterator instead of Qt QDirIterator object.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/folderlistmodel/filesystemaction.cpp'
2--- src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 22:06:23 +0000
3+++ src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 22:06:23 +0000
4@@ -39,6 +39,7 @@
5 #include "qtrashutilinfo.h"
6 #include "location.h"
7 #include "locationsfactory.h"
8+#include "locationitemdiriterator.h"
9
10
11 #if defined(Q_OS_UNIX)
12@@ -370,15 +371,24 @@
13 //ActionMove will perform a rename, so no Directory expanding is necessary
14 if (entry->type != ActionMove && info->isDir() && !info->isSymLink())
15 {
16- QDirIterator it(info->absoluteFilePath(),
17+ LocationItemDirIterator *it =
18+ action->sourceLocation->newDirIterator(info->absoluteFilePath(),
19 QDir::AllEntries | QDir::System |
20 QDir::NoDotAndDotDot | QDir::Hidden,
21 QDirIterator::Subdirectories);
22- while (it.hasNext() && !it.next().isEmpty())
23+ while (it->hasNext() && !it->next().isEmpty())
24 {
25- entry->reversedOrder.prepend(it.fileInfo());
26+ entry->reversedOrder.prepend(it->fileInfo());
27 }
28- }
29+ delete it;
30+ }
31+#if DEBUG_MESSAGES
32+ for (int counter = 0; counter < entry->reversedOrder.count(); counter++)
33+ {
34+ const DirItemInfo & item = entry->reversedOrder.at(counter);
35+ qDebug() << Q_FUNC_INFO << "reversedOrder" << counter << item.absoluteFilePath();
36+ }
37+#endif
38 //set steps and total bytes considering all items in the Entry
39 int counter = entry->reversedOrder.count();
40 qint64 size = 0;
41@@ -408,8 +418,8 @@
42 action->steps += entrySteps;
43 action->totalItems += entry->reversedOrder.count();
44 #if DEBUG_MESSAGES
45- qDebug() << "entrySteps" << entrySteps << "from entry counter" << entry->reversedOrder.count()
46- << "total steps" << action->steps;
47+ qDebug() << Q_FUNC_INFO << "entrySteps" << entrySteps << "from entry counter"
48+ << entry->reversedOrder.count() << "total steps" << action->steps;
49 #endif
50
51 return true;

Subscribers

People subscribed via source and target branches