← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Carlos Jose Mazieri has proposed merging lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09 into lp:ubuntu-filemanager-app with lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-08 as a prerequisite.

Commit message:
Actions are using LocationItemDirIterator instead of Qt QDirIterator object.

Requested reviews:
  Ubuntu File Manager Developers (ubuntu-filemanager-dev)

For more details, see:
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09/+merge/265200

Actions are using LocationItemDirIterator instead of Qt QDirIterator object.
-- 
Your team Ubuntu File Manager Developers is requested to review the proposed merge of lp:~carlos-mazieri/ubuntu-filemanager-app/samba-actions-09 into lp:ubuntu-filemanager-app.
=== 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 @@
 #include "qtrashutilinfo.h"
 #include "location.h"
 #include "locationsfactory.h"
+#include "locationitemdiriterator.h"
 
 
 #if defined(Q_OS_UNIX)
@@ -370,15 +371,24 @@
     //ActionMove will perform a rename, so no Directory expanding is necessary
     if (entry->type != ActionMove && info->isDir() && !info->isSymLink())
     {
-        QDirIterator it(info->absoluteFilePath(),
+        LocationItemDirIterator *it =
+        action->sourceLocation->newDirIterator(info->absoluteFilePath(),
                         QDir::AllEntries | QDir::System |
                               QDir::NoDotAndDotDot | QDir::Hidden,
                         QDirIterator::Subdirectories);
-        while (it.hasNext() &&  !it.next().isEmpty())
+        while (it->hasNext() &&  !it->next().isEmpty())
         {
-            entry->reversedOrder.prepend(it.fileInfo());
+            entry->reversedOrder.prepend(it->fileInfo());
         }
-    }
+        delete it;
+    }
+#if DEBUG_MESSAGES
+    for (int counter = 0; counter < entry->reversedOrder.count(); counter++)
+    {
+        const DirItemInfo & item = entry->reversedOrder.at(counter);
+        qDebug() << Q_FUNC_INFO << "reversedOrder" << counter << item.absoluteFilePath();
+    }
+#endif
     //set steps and total bytes considering all items in the Entry
     int counter = entry->reversedOrder.count();
     qint64 size = 0;
@@ -408,8 +418,8 @@
     action->steps      += entrySteps;
     action->totalItems += entry->reversedOrder.count();
 #if DEBUG_MESSAGES
-    qDebug() << "entrySteps" << entrySteps << "from entry counter" << entry->reversedOrder.count()
-             << "total steps" << action->steps;
+    qDebug() << Q_FUNC_INFO << "entrySteps"  << entrySteps << "from entry counter"
+             << entry->reversedOrder.count() << "total steps" << action->steps;
 #endif
 
     return true;


Follow ups