]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kdirectorycontentscounterworker.h
[Details mode] Allow to fill the column size of directories with actual size
[dolphin.git] / src / kitemviews / private / kdirectorycontentscounterworker.h
index b2e31ef0f838f74a8bd979f77fca6b3c31ac4dff..fac9978d5fe357d08af1f68fd3ccb5367d12a94b 100644 (file)
@@ -17,8 +17,8 @@
  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
-#ifndef KDIRECTORYCONTENTENTSCOUNTERWORKER_H
-#define KDIRECTORYCONTENTENTSCOUNTERWORKER_H
+#ifndef KDIRECTORYCONTENTSCOUNTERWORKER_H
+#define KDIRECTORYCONTENTSCOUNTERWORKER_H
 
 #include <QMetaType>
 #include <QObject>
@@ -37,7 +37,15 @@ public:
     };
     Q_DECLARE_FLAGS(Options, Option)
 
-    explicit KDirectoryContentsCounterWorker(QObject* parent = 0);
+    struct CountResult {
+        /// number of elements in the directory
+        int count;
+        /// Recursive sum of the size of the directory content files and folders
+        /// Calculation depends on DetailsModeSettings::recursiveDirectorySizeLimit
+        long size;
+    };
+
+    explicit KDirectoryContentsCounterWorker(QObject* parent = nullptr);
 
     /**
      * Counts the items inside the directory \a path using the options
@@ -45,13 +53,13 @@ public:
      *
      * @return The number of items.
      */
-    static int subItemsCount(const QString& path, Options options);
+    static CountResult subItemsCount(const QString& path, Options options);
 
 signals:
     /**
-     * Signals that the directory \a path contains \a count items.
+     * Signals that the directory \a path contains \a count items and optionally the size of its content.
      */
-    void result(const QString& path, int count);
+    void result(const QString& path, int count, long size);
 
 public slots:
     /**