Skip to content

Commit

Permalink
Prepare to fix deprecation warning when using OBS 31
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
WarmUpTill committed Nov 2, 2024
1 parent 3367106 commit c7e1710
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions plugins/base/macro-action-systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c7e1710

Please sign in to comment.