Convert m_previousShutdownSafe to new settings API

This commit is contained in:
Vasily
2019-12-10 08:28:41 +01:00
committed by username223
parent 4ae8bd8fb5
commit adc3a1e7b2
2 changed files with 9 additions and 20 deletions
+8 -15
View File
@@ -298,12 +298,6 @@ OverlayController::OverlayController( bool desktopMode,
m_customTickRateMs = value.toInt();
}
}
value = appSettings()->value( "previousShutdownSafe",
m_previousShutdownSafe );
if ( value.isValid() && !value.isNull() )
{
m_previousShutdownSafe = value.toBool();
}
value = appSettings()->value( "crashRecoveryDisabled",
m_crashRecoveryDisabled );
if ( value.isValid() && !value.isNull() )
@@ -884,15 +878,8 @@ void OverlayController::setDebugState( int value, bool notify )
void OverlayController::setPreviousShutdownSafe( bool value )
{
if ( m_previousShutdownSafe == value )
{
return;
}
m_previousShutdownSafe = value;
appSettings()->beginGroup( "applicationSettings" );
appSettings()->setValue( "previousShutdownSafe", m_previousShutdownSafe );
appSettings()->endGroup();
appSettings()->sync();
settings::setSetting(
settings::BoolSetting::APPLICATION_previousShutdownSafe, value );
}
int OverlayController::customTickRateMs() const
@@ -1468,6 +1455,12 @@ void OverlayController::RotateCollisionBounds( float angle, bool commit )
}
}
bool OverlayController::isPreviousShutdownSafe()
{
return settings::getSetting(
settings::BoolSetting::APPLICATION_previousShutdownSafe );
}
QString OverlayController::getVersionString()
{
return QString( application_strings::applicationVersionString );