19 m_blacklist.blacklist(
":/qt-project.org");
20 m_blacklist.blacklist(
":/QtQuick/Controls/Styles");
21 m_blacklist.blacklist(
":/ExtrasImports/QtQuick/Controls/Styles");
24 m_blacklist.blacklist(
"/etc");
26 for (
int loc = QLibraryInfo::PrefixPath; loc < QLibraryInfo::TestsPath; ++loc) {
27 m_blacklist.blacklist(QLibraryInfo::path(
28 static_cast<QLibraryInfo::LibraryPath>(loc)));
30 m_blacklist.blacklist(QLibraryInfo::path(QLibraryInfo::SettingsPath));
32 static const QStandardPaths::StandardLocation blackListLocations[] = {
33 QStandardPaths::CacheLocation,
34 QStandardPaths::GenericDataLocation,
35 QStandardPaths::ConfigLocation,
36 QStandardPaths::GenericCacheLocation,
37 QStandardPaths::GenericConfigLocation,
38 QStandardPaths::AppDataLocation,
39 QStandardPaths::AppConfigLocation
42 for (
auto locationType : blackListLocations) {
43 const QStringList locations = QStandardPaths::standardLocations(locationType);
44 for (
const QString &location : locations)
45 m_blacklist.blacklist(location);
48 m_blacklist.whitelist(QLibraryInfo::path(QLibraryInfo::TestsPath));
50 connect(
this, &QQmlPreviewFileLoader::request, service, &QQmlPreviewServiceImpl::forwardRequest,
51 Qt::DirectConnection);
52 connect(service, &QQmlPreviewServiceImpl::directory,
this, &QQmlPreviewFileLoader::directory);
53 connect(service, &QQmlPreviewServiceImpl::file,
this, &QQmlPreviewFileLoader::file);
54 connect(service, &QQmlPreviewServiceImpl::error,
this, &QQmlPreviewFileLoader::error);
55 connect(service, &QQmlPreviewServiceImpl::clearCache,
this, &QQmlPreviewFileLoader::clearCache);
56 moveToThread(&m_thread);
67 QMutexLocker locker(&m_contentMutex);
70 auto fileIterator = m_fileCache.constFind(path);
71 if (fileIterator != m_fileCache.constEnd()) {
73 m_contents = *fileIterator;
78 auto dirIterator = m_directoryCache.constFind(path);
79 if (dirIterator != m_directoryCache.constEnd()) {
82 m_entries = *dirIterator;
90 m_waitCondition.wait(&m_contentMutex);