From db50822b0518ed224d17b9537aef029c00188e43 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Sat, 2 Nov 2024 08:00:52 +0100 Subject: [PATCH] Prepare to fix deprecation warning when using OBS 31 The following log message will be present in OBS 31 when CheckIfTrayIsDisabled() is called: DEPRECATION: obs_frontend_get_global_config is deprecated. Read from global or user configuration explicitly instead. It will be resolved when the minimum OBS version is bumped to OBS 31. --- plugins/base/macro-action-systray.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/plugins/base/macro-action-systray.cpp b/plugins/base/macro-action-systray.cpp index d997e3c3..afb96069 100644 --- a/plugins/base/macro-action-systray.cpp +++ b/plugins/base/macro-action-systray.cpp @@ -123,27 +123,23 @@ MacroActionSystrayEdit::MacroActionSystrayEdit( void MacroActionSystrayEdit::TitleChanged() { - if (_loading || !_entryData) { - return; - } - - auto lock = LockContext(); + GUARD_LOADING_AND_LOCK(); _entryData->_title = _title->text().toStdString(); } void MacroActionSystrayEdit::IconPathChanged(const QString &text) { - if (_loading || !_entryData) { - return; - } - - auto lock = LockContext(); + GUARD_LOADING_AND_LOCK(); _entryData->_iconPath = text.toStdString(); } void MacroActionSystrayEdit::CheckIfTrayIsDisabled() { +#if LIBOBS_API_VER >= MAKE_SEMANTIC_VERSION(31, 0, 0) + auto config = obs_frontend_get_user_config(); +#else auto config = obs_frontend_get_global_config(); +#endif if (!config) { return; }