]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kdirectorycontentscounter.cpp
Fix minor typos
[dolphin.git] / src / kitemviews / private / kdirectorycontentscounter.cpp
index cd448e233af6f3ee5a70214c3b79f4b95683c95b..977a83d5dd28b7f16a1938b26dde9f9ed0b679e4 100644 (file)
  ***************************************************************************/
 
 #include "kdirectorycontentscounter.h"
-
-#include "kdirectorycontentscounterworker.h"
-#include <kitemviews/kfileitemmodel.h>
+#include "kitemviews/kfileitemmodel.h"
 
 #include <KDirWatch>
+
 #include <QThread>
 
 KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObject* parent) :
     QObject(parent),
     m_model(model),
     m_queue(),
-    m_worker(0),
+    m_worker(nullptr),
     m_workerIsBusy(false),
-    m_dirWatcher(0),
+    m_dirWatcher(nullptr),
     m_watchedDirs()
 {
     connect(m_model, &KFileItemModel::itemsRemoved,
@@ -70,7 +69,7 @@ KDirectoryContentsCounter::~KDirectoryContentsCounter()
         m_workerThread->quit();
         m_workerThread->wait();
         delete m_workerThread;
-        m_workerThread = 0;
+        m_workerThread = nullptr;
 
         // The worker thread has finished running now, so it's safe to delete
         // m_worker. deleteLater() would not work at all because the event loop
@@ -122,7 +121,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count)
 
 void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path)
 {
-    const int index = m_model->index(KUrl(path));
+    const int index = m_model->index(QUrl::fromLocalFile(path));
     if (index >= 0) {
         if (!m_model->fileItem(index).isDir()) {
             // If INotify is used, KDirWatch issues the dirty() signal
@@ -151,7 +150,7 @@ void KDirectoryContentsCounter::slotItemsRemoved()
             QMutableSetIterator<QString> it(m_watchedDirs);
             while (it.hasNext()) {
                 const QString& path = it.next();
-                if (m_model->index(KUrl(path)) < 0) {
+                if (m_model->index(QUrl::fromLocalFile(path)) < 0) {
                     m_dirWatcher->removeDir(path);
                     it.remove();
                 }
@@ -180,5 +179,5 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
     }
 }
 
-QThread* KDirectoryContentsCounter::m_workerThread = 0;
-int KDirectoryContentsCounter::m_workersCount = 0;
\ No newline at end of file
+QThread* KDirectoryContentsCounter::m_workerThread = nullptr;
+int KDirectoryContentsCounter::m_workersCount = 0;