Add FSEngine FilePath Cache

To speed up file dialogs we introduce a 1 minute cache for
the FilePathInfo.

A new version of "IDevice::iterateDirectories" allows implementations to
provide the FilePathInfo directly.

DockerDevice implements fetching the filePathInfo during
iterateDirectories which greatly improves the speed again.

Change-Id: I24ac16adb2478cbf16a22012e72fcb8910dcdac5
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-10-05 15:42:14 +02:00
parent e5e90ad931
commit ae58d373b0
14 changed files with 579 additions and 124 deletions

View File

@@ -35,7 +35,7 @@ class CommandLine;
struct QTCREATOR_UTILS_EXPORT RunResult
{
int exitCode = 0;
int exitCode = -1;
QByteArray stdOut;
QByteArray stdErr;
};
@@ -97,10 +97,19 @@ public:
const FileFilter &filter,
bool *useFind,
const std::function<RunResult(const CommandLine &)> &runInShell,
const std::function<bool(const FilePath &)> &callBack);
const FilePath::IterateDirCallback &callBack);
static void iterateUnixDirectory(
const FilePath &base,
const FileFilter &filter,
bool *useFind,
const std::function<RunResult(const CommandLine &)> &runInShell,
const FilePath::IterateDirWithInfoCallback &callBack);
static qint64 bytesAvailableFromDFOutput(const QByteArray &dfOutput);
static FilePathInfo filePathInfoFromTriple(const QString &infos);
#ifdef QT_WIDGETS_LIB
static void setDialogParentGetter(const std::function<QWidget *()> &getter);