summaryrefslogtreecommitdiffstats
path: root/cachedfiledata.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-01-02 22:09:07 +0100
committerArno <arno@disconnect.de>2018-01-02 22:09:07 +0100
commitb5dc8c10367537aec8ce7c061f608ca896ec9f36 (patch)
tree3038603c5b485b8a92593a2b24295327d9b71702 /cachedfiledata.h
parentc77061d4d19de23c805ccbcc7cc229b221d4c1d5 (diff)
downloadShemovCleaner-b5dc8c10367537aec8ce7c061f608ca896ec9f36.tar.gz
ShemovCleaner-b5dc8c10367537aec8ce7c061f608ca896ec9f36.tar.bz2
ShemovCleaner-b5dc8c10367537aec8ce7c061f608ca896ec9f36.zip
Implement cache for FileWidget
Some data-gathering is quite expensive and requires a QProcess, like getting the duration, so cache it in memory using QCache. Once the cache is filled, the UI is much snappier. This simplifies gatherData() a bit. It's still quite a long function, but now it doesn't create the QStandardItems any more. I moved it to a separate function.
Diffstat (limited to 'cachedfiledata.h')
-rw-r--r--cachedfiledata.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cachedfiledata.h b/cachedfiledata.h
new file mode 100644
index 0000000..9b5fe48
--- /dev/null
+++ b/cachedfiledata.h
@@ -0,0 +1,19 @@
+#ifndef CACHEDFILEDATA_H
+#define CACHEDFILEDATA_H
+
+#include <QString>
+
+struct CachedFileData {
+ explicit CachedFileData();
+ QString fullPath;
+ QString name;
+ QString mimeType;
+ QString duration;
+ QString md5Sum;
+ qint64 seconds;
+ qint64 size;
+ int attr;
+ bool copied;
+};
+
+#endif // CACHEDFILEDATA_H