Merge pull request #1722 from Scrumplex/fix/readonly-themes

This commit is contained in:
Sefa Eyeoglu 2023-10-18 09:25:48 +02:00 committed by GitHub
commit 2081fcd3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,11 +165,15 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QFileInfo& fileInfo, bool isManifest
QString path = FS::PathCombine("themes", m_id); QString path = FS::PathCombine("themes", m_id);
QString pathResources = FS::PathCombine("themes", m_id, "resources"); QString pathResources = FS::PathCombine("themes", m_id, "resources");
if (!FS::ensureFolderPathExists(path) || !FS::ensureFolderPathExists(pathResources)) { if (!FS::ensureFolderPathExists(path)) {
themeWarningLog() << "couldn't create folder for theme!"; themeWarningLog() << "Theme directory for" << m_id << "could not be created. This theme might be invalid";
return; return;
} }
if (!FS::ensureFolderPathExists(pathResources)) {
themeWarningLog() << "Resources directory for" << m_id << "could not be created";
}
auto themeFilePath = FS::PathCombine(path, themeFile); auto themeFilePath = FS::PathCombine(path, themeFile);
bool jsonDataIncomplete = false; bool jsonDataIncomplete = false;
@ -230,7 +234,11 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QFileInfo& fileInfo, bool isManifest
QStringList CustomTheme::searchPaths() QStringList CustomTheme::searchPaths()
{ {
return { FS::PathCombine("themes", m_id, "resources") }; QString pathResources = FS::PathCombine("themes", m_id, "resources");
if (QFileInfo::exists(pathResources))
return { pathResources };
return {};
} }
QString CustomTheme::id() QString CustomTheme::id()