Add m_debugState to new settings API

This commit is contained in:
Vasily
2019-12-10 08:28:41 +01:00
committed by username223
parent 598d77a0e7
commit 87bf59fd31
4 changed files with 11 additions and 17 deletions
+4 -16
View File
@@ -298,11 +298,6 @@ OverlayController::OverlayController( bool desktopMode,
m_customTickRateMs = value.toInt();
}
}
value = appSettings()->value( "debugState", m_debugState );
if ( value.isValid() && !value.isNull() )
{
m_debugState = value.toInt();
}
appSettings()->endGroup();
// Grab local version number
@@ -821,23 +816,16 @@ void OverlayController::setVersionCheckText( QString value, bool notify )
int OverlayController::debugState() const
{
return m_debugState;
return settings::getSetting( settings::IntSetting::APPLICATION_debugState );
}
void OverlayController::setDebugState( int value, bool notify )
{
if ( m_debugState == value )
{
return;
}
m_debugState = value;
appSettings()->beginGroup( "applicationSettings" );
appSettings()->setValue( "debugState", m_debugState );
appSettings()->endGroup();
appSettings()->sync();
settings::setSetting( settings::IntSetting::APPLICATION_debugState, value );
if ( notify )
{
emit debugStateChanged( m_debugState );
emit debugStateChanged( value );
}
}