18 m_blacklist.blacklist(
":/qt-project.org");
19 m_blacklist.blacklist(
":/QtQuick/Controls/Styles");
20 m_blacklist.blacklist(
":/ExtrasImports/QtQuick/Controls/Styles");
23 m_blacklist.blacklist(
"/etc");
25 for (
int loc = QLibraryInfo::PrefixPath; loc < QLibraryInfo::TestsPath; ++loc) {
26 m_blacklist.blacklist(QLibraryInfo::path(
27 static_cast<QLibraryInfo::LibraryPath>(loc)));
29 m_blacklist.blacklist(QLibraryInfo::path(QLibraryInfo::SettingsPath));
31 static const QStandardPaths::StandardLocation blackListLocations[] = {
32 QStandardPaths::CacheLocation,
33 QStandardPaths::GenericDataLocation,
34 QStandardPaths::ConfigLocation,
35 QStandardPaths::GenericCacheLocation,
36 QStandardPaths::GenericConfigLocation,
37 QStandardPaths::AppDataLocation,
38 QStandardPaths::AppConfigLocation
41 for (
auto locationType : blackListLocations) {
42 const QStringList locations = QStandardPaths::standardLocations(locationType);
43 for (
const QString &location : locations)
44 m_blacklist.blacklist(location);
47 m_blacklist.whitelist(QLibraryInfo::path(QLibraryInfo::TestsPath));
49 connect(
this, &QQmlPreviewFileLoader::request, service, &QQmlPreviewServiceImpl::forwardRequest,
50 Qt::DirectConnection);
51 connect(service, &QQmlPreviewServiceImpl::directory,
this, &QQmlPreviewFileLoader::directory);
52 connect(service, &QQmlPreviewServiceImpl::file,
this, &QQmlPreviewFileLoader::file);
53 connect(service, &QQmlPreviewServiceImpl::error,
this, &QQmlPreviewFileLoader::error);
54 connect(service, &QQmlPreviewServiceImpl::clearCache,
this, &QQmlPreviewFileLoader::clearCache);
55 moveToThread(&m_thread);
66 QMutexLocker locker(&m_contentMutex);
69 auto fileIterator = m_fileCache.constFind(path);
70 if (fileIterator != m_fileCache.constEnd()) {
72 m_contents = *fileIterator;
77 auto dirIterator = m_directoryCache.constFind(path);
78 if (dirIterator != m_directoryCache.constEnd()) {
81 m_entries = *dirIterator;
89 m_waitCondition.wait(&m_contentMutex);