20 moveToThread(service->thread());
24 m_blacklist.blacklist(
":/qt-project.org");
25 m_blacklist.blacklist(
":/QtQuick/Controls/Styles");
26 m_blacklist.blacklist(
":/ExtrasImports/QtQuick/Controls/Styles");
29 m_blacklist.blacklist(
"/etc");
31 for (
int loc = QLibraryInfo::PrefixPath; loc < QLibraryInfo::TestsPath; ++loc) {
32 m_blacklist.blacklist(QLibraryInfo::path(
33 static_cast<QLibraryInfo::LibraryPath>(loc)));
35 m_blacklist.blacklist(QLibraryInfo::path(QLibraryInfo::SettingsPath));
37 static const QStandardPaths::StandardLocation blackListLocations[] = {
38 QStandardPaths::CacheLocation,
39 QStandardPaths::GenericDataLocation,
40 QStandardPaths::ConfigLocation,
41 QStandardPaths::GenericCacheLocation,
42 QStandardPaths::GenericConfigLocation,
43 QStandardPaths::AppDataLocation,
44 QStandardPaths::AppConfigLocation
47 for (
auto locationType : blackListLocations) {
48 const QStringList locations = QStandardPaths::standardLocations(locationType);
49 for (
const QString &location : locations)
50 m_blacklist.blacklist(location);
53 m_blacklist.whitelist(QLibraryInfo::path(QLibraryInfo::TestsPath));
59 connect(
this, &QQmlPreviewFileLoader::request, service, &QQmlPreviewServiceImpl::forwardRequest,
60 Qt::DirectConnection);
61 connect(service, &QQmlPreviewServiceImpl::directory,
this, &QQmlPreviewFileLoader::directory,
62 Qt::DirectConnection);
63 connect(service, &QQmlPreviewServiceImpl::file,
this, &QQmlPreviewFileLoader::file,
64 Qt::DirectConnection);
65 connect(service, &QQmlPreviewServiceImpl::error,
this, &QQmlPreviewFileLoader::error,
66 Qt::DirectConnection);
67 connect(service, &QQmlPreviewServiceImpl::clearCache,
this, &QQmlPreviewFileLoader::clearCache,
68 Qt::DirectConnection);
73 QMutexLocker locker(&m_contentMutex);
76 auto fileIterator = m_fileCache.constFind(path);
77 if (fileIterator != m_fileCache.constEnd()) {
79 m_contents = *fileIterator;
84 auto dirIterator = m_directoryCache.constFind(path);
85 if (dirIterator != m_directoryCache.constEnd()) {
88 m_entries = *dirIterator;
96 m_waitCondition.wait(&m_contentMutex);