UI: Avoid allowing to override provided themes

This commit is contained in:
tytan652
2024-06-10 17:01:21 -04:00
committed by Ryan Foster
parent 00c68981ab
commit c677bac875
+10 -10
View File
@@ -425,6 +425,16 @@ void OBSApp::FindThemes()
<< "*.oha" // OBS High-contrast Adjustment layer
;
GetDataFilePath("themes/", themeDir);
QDirIterator it(QString::fromStdString(themeDir), filters, QDir::Files);
while (it.hasNext()) {
OBSTheme *theme = ParseThemeMeta(it.next());
if (theme && !themes.contains(theme->id))
themes[theme->id] = std::move(*theme);
else
delete theme;
}
if (GetConfigPath(themeDir.data(), themeDir.capacity(),
"obs-studio/themes/") > 0) {
QDirIterator it(QT_UTF8(themeDir.c_str()), filters,
@@ -439,16 +449,6 @@ void OBSApp::FindThemes()
}
}
GetDataFilePath("themes/", themeDir);
QDirIterator it(QString::fromStdString(themeDir), filters, QDir::Files);
while (it.hasNext()) {
OBSTheme *theme = ParseThemeMeta(it.next());
if (theme && !themes.contains(theme->id))
themes[theme->id] = std::move(*theme);
else
delete theme;
}
/* Build dependency tree for all themes, removing ones that have items missing. */
QSet<QString> invalid;