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

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
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 Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
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.

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
=== modified file 'src/plugin/folderlistmodel/filesystemaction.cpp'
--- src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 22:06:23 +0000
+++ src/plugin/folderlistmodel/filesystemaction.cpp 2015-07-18 22:06:23 +0000
@@ -39,6 +39,7 @@
39#include "qtrashutilinfo.h"39#include "qtrashutilinfo.h"
40#include "location.h"40#include "location.h"
41#include "locationsfactory.h"41#include "locationsfactory.h"
42#include "locationitemdiriterator.h"
4243
4344
44#if defined(Q_OS_UNIX)45#if defined(Q_OS_UNIX)
@@ -370,15 +371,24 @@
370 //ActionMove will perform a rename, so no Directory expanding is necessary371 //ActionMove will perform a rename, so no Directory expanding is necessary
371 if (entry->type != ActionMove && info->isDir() && !info->isSymLink())372 if (entry->type != ActionMove && info->isDir() && !info->isSymLink())
372 {373 {
373 QDirIterator it(info->absoluteFilePath(),374 LocationItemDirIterator *it =
375 action->sourceLocation->newDirIterator(info->absoluteFilePath(),
374 QDir::AllEntries | QDir::System |376 QDir::AllEntries | QDir::System |
375 QDir::NoDotAndDotDot | QDir::Hidden,377 QDir::NoDotAndDotDot | QDir::Hidden,
376 QDirIterator::Subdirectories);378 QDirIterator::Subdirectories);
377 while (it.hasNext() && !it.next().isEmpty())379 while (it->hasNext() && !it->next().isEmpty())
378 {380 {
379 entry->reversedOrder.prepend(it.fileInfo());381 entry->reversedOrder.prepend(it->fileInfo());
380 }382 }
381 }383 delete it;
384 }
385#if DEBUG_MESSAGES
386 for (int counter = 0; counter < entry->reversedOrder.count(); counter++)
387 {
388 const DirItemInfo & item = entry->reversedOrder.at(counter);
389 qDebug() << Q_FUNC_INFO << "reversedOrder" << counter << item.absoluteFilePath();
390 }
391#endif
382 //set steps and total bytes considering all items in the Entry392 //set steps and total bytes considering all items in the Entry
383 int counter = entry->reversedOrder.count();393 int counter = entry->reversedOrder.count();
384 qint64 size = 0;394 qint64 size = 0;
@@ -408,8 +418,8 @@
408 action->steps += entrySteps;418 action->steps += entrySteps;
409 action->totalItems += entry->reversedOrder.count();419 action->totalItems += entry->reversedOrder.count();
410#if DEBUG_MESSAGES420#if DEBUG_MESSAGES
411 qDebug() << "entrySteps" << entrySteps << "from entry counter" << entry->reversedOrder.count()421 qDebug() << Q_FUNC_INFO << "entrySteps" << entrySteps << "from entry counter"
412 << "total steps" << action->steps;422 << entry->reversedOrder.count() << "total steps" << action->steps;
413#endif423#endif
414424
415 return true;425 return true;

Subscribers

People subscribed via source and target branches