From c677bac875e6b3b6e4d3358aa8b38679ff4fcb1f Mon Sep 17 00:00:00 2001 From: tytan652 Date: Sun, 9 Jun 2024 02:00:25 +0200 Subject: [PATCH] UI: Avoid allowing to override provided themes --- UI/obs-app-theming.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/UI/obs-app-theming.cpp b/UI/obs-app-theming.cpp index 6571c9529..669594eff 100644 --- a/UI/obs-app-theming.cpp +++ b/UI/obs-app-theming.cpp @@ -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 invalid;