* 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>
};
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
*
* @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:
/**