]> 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 2460a0e1ff132d28300494b37c56cbb9f6f8e6d4..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,6 +37,14 @@ public:
     };
     Q_DECLARE_FLAGS(Options, Option)
 
+    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);
 
     /**
@@ -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:
     /**