frontend: Fix warning for themeWatcher

This commit is contained in:
Warchamp7
2026-03-21 16:33:41 -04:00
committed by Ryan Foster
parent 5f2720ac98
commit 1b41b44b50
+6 -7
View File
@@ -962,7 +962,6 @@ bool OBSApp::SetTheme(const QString &name)
void OBSApp::themeFileChanged(const QString &path)
{
themeWatcher->blockSignals(true);
blog(LOG_INFO, "Theme file \"%s\" changed, reloading...", QT_TO_UTF8(path));
SetTheme(currentTheme->id);
}
@@ -1002,12 +1001,6 @@ bool OBSApp::InitTheme()
/* Load list of themes and read their metadata */
FindThemes();
if (config_get_bool(userConfig, "Appearance", "AutoReload")) {
/* Set up Qt file watcher to automatically reload themes */
themeWatcher = new QFileSystemWatcher(this);
connect(themeWatcher.get(), &QFileSystemWatcher::fileChanged, this, &OBSApp::themeFileChanged);
}
/* Migrate old theme config key */
if (config_has_user_value(userConfig, "General", "CurrentTheme3") &&
!config_has_user_value(userConfig, "Appearance", "Theme")) {
@@ -1042,5 +1035,11 @@ bool OBSApp::InitTheme()
return SetTheme("com.obsproject.System");
}
if (config_get_bool(userConfig, "Appearance", "AutoReload")) {
/* Set up Qt file watcher to automatically reload themes */
themeWatcher = new QFileSystemWatcher(this);
connect(themeWatcher.get(), &QFileSystemWatcher::fileChanged, this, &OBSApp::themeFileChanged);
}
return true;
}