]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kdirectorycontentscounter.h
Add clang-format and format code as in Frameworks
[dolphin.git] / src / kitemviews / private / kdirectorycontentscounter.h
index 65c4bcb1babc52e19c8012655204824512573d71..f74565b73af48b29d893a17957b26da13e1ba6c8 100644 (file)
@@ -1,31 +1,16 @@
-/***************************************************************************
- *   Copyright (C) 2011 by Peter Penz <peter.penz19@gmail.com>             *
- *   Copyright (C) 2013 by Frank Reininghaus <frank78ac@googlemail.com>    *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
- ***************************************************************************/
+/*
+ *   SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com>
+ *   SPDX-FileCopyrightText: 2013 Frank Reininghaus <frank78ac@googlemail.com>
+ *
+ *   SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #ifndef KDIRECTORYCONTENTSCOUNTER_H
 #define KDIRECTORYCONTENTSCOUNTER_H
 
 #include "kdirectorycontentscounterworker.h"
 
-#include <QLinkedList>
 #include <QSet>
-#include <QHash>
 
 class KDirWatch;
 class KFileItemModel;
@@ -36,7 +21,7 @@ class KDirectoryContentsCounter : public QObject
     Q_OBJECT
 
 public:
-    explicit KDirectoryContentsCounter(KFileItemModel* model, QObject* parent = nullptr);
+    explicit KDirectoryContentsCounter(KFileItemModel *model, QObject *parent = nullptr);
     ~KDirectoryContentsCounter() override;
 
     /**
@@ -50,40 +35,40 @@ public:
      * Uses a cache internally to speed up first result,
      * but emit again result when the cache was updated
      */
-    void scanDirectory(const QStringpath);
+    void scanDirectory(const QString &path);
 
-signals:
+Q_SIGNALS:
     /**
      * Signals that the directory \a path contains \a count items of size \a
      * Size calculation depends on parameter DetailsModeSettings::recursiveDirectorySizeLimit
      */
-    void result(const QStringpath, int count, long size);
+    void result(const QString &path, int count, long size);
 
-    void requestDirectoryContentsCount(const QStringpath, KDirectoryContentsCounterWorker::Options options);
+    void requestDirectoryContentsCount(const QString &path, KDirectoryContentsCounterWorker::Options options);
 
-private slots:
-    void slotResult(const QStringpath, int count, long size);
-    void slotDirWatchDirty(const QStringpath);
+private Q_SLOTS:
+    void slotResult(const QString &path, int count, long size);
+    void slotDirWatchDirty(const QString &path);
     void slotItemsRemoved();
 
 private:
-    void startWorker(const QStringpath);
+    void startWorker(const QString &path);
 
 private:
-    KFileItemModelm_model;
+    KFileItemModel *m_model;
 
     // Used as FIFO queues.
-    QLinkedList<QString> m_priorityQueue;
-    QLinkedList<QString> m_queue;
+    std::list<QString> m_priorityQueue;
+    std::list<QString> m_queue;
 
-    static QThreadm_workerThread;
+    static QThread *m_workerThread;
 
-    KDirectoryContentsCounterWorkerm_worker;
+    KDirectoryContentsCounterWorker *m_worker;
     bool m_workerIsBusy;
 
-    KDirWatchm_dirWatcher;
-    QSet<QString> m_watchedDirs;    // Required as sadly KDirWatch does not offer a getter method
-                                    // to get all watched directories.
+    KDirWatch *m_dirWatcher;
+    QSet<QString> m_watchedDirs; // Required as sadly KDirWatch does not offer a getter method
+                                 // to get all watched directories.
 };
 
 #endif