From b5dc8c10367537aec8ce7c061f608ca896ec9f36 Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 2 Jan 2018 22:09:07 +0100 Subject: 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. --- cachedfiledata.cpp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 cachedfiledata.cpp (limited to 'cachedfiledata.cpp') diff --git a/cachedfiledata.cpp b/cachedfiledata.cpp new file mode 100644 index 0000000..6f51edb --- /dev/null +++ b/cachedfiledata.cpp @@ -0,0 +1,3 @@ +#include "cachedfiledata.h" + +CachedFileData::CachedFileData() : seconds(0), size(0), attr(-1), copied(false) {} -- cgit v1.2.3-70-g09d2