Add m_enableDebug to new settings API

This commit is contained in:
Vasily
2019-12-10 08:28:41 +01:00
committed by username223
parent bed0939ddf
commit c8b271ad3e
4 changed files with 10 additions and 17 deletions
+5 -16
View File
@@ -298,11 +298,6 @@ OverlayController::OverlayController( bool desktopMode,
m_customTickRateMs = value.toInt(); m_customTickRateMs = value.toInt();
} }
} }
value = appSettings()->value( "enableDebug", m_enableDebug );
if ( value.isValid() && !value.isNull() )
{
m_enableDebug = value.toBool();
}
value value
= appSettings()->value( "disableVersionCheck", m_disableVersionCheck ); = appSettings()->value( "disableVersionCheck", m_disableVersionCheck );
if ( value.isValid() && !value.isNull() ) if ( value.isValid() && !value.isNull() )
@@ -761,23 +756,17 @@ void OverlayController::setVsyncDisabled( bool value, bool notify )
bool OverlayController::enableDebug() const bool OverlayController::enableDebug() const
{ {
return m_enableDebug; return settings::getSetting(
settings::BoolSetting::APPLICATION_enableDebug );
} }
void OverlayController::setEnableDebug( bool value, bool notify ) void OverlayController::setEnableDebug( bool value, bool notify )
{ {
if ( m_enableDebug == value ) settings::setSetting( settings::BoolSetting::APPLICATION_enableDebug,
{ value );
return;
}
m_enableDebug = value;
appSettings()->beginGroup( "applicationSettings" );
appSettings()->setValue( "enableDebug", m_enableDebug );
appSettings()->endGroup();
appSettings()->sync();
if ( notify ) if ( notify )
{ {
emit enableDebugChanged( m_enableDebug ); emit enableDebugChanged( value );
} }
} }
-1
View File
@@ -121,7 +121,6 @@ private:
bool m_desktopMode; bool m_desktopMode;
bool m_noSound; bool m_noSound;
bool m_enableDebug = false;
bool m_disableVersionCheck = false; bool m_disableVersionCheck = false;
bool m_newVersionDetected = false; bool m_newVersionDetected = false;
int m_customTickRateMs = 20; int m_customTickRateMs = 20;
+1
View File
@@ -27,6 +27,7 @@ enum class BoolSetting
APPLICATION_previousShutdownSafe, APPLICATION_previousShutdownSafe,
APPLICATION_vsyncDisabled, APPLICATION_vsyncDisabled,
APPLICATION_crashRecoveryDisabled, APPLICATION_crashRecoveryDisabled,
APPLICATION_enableDebug,
VIDEO_brightnessEnabled, VIDEO_brightnessEnabled,
VIDEO_isOverlayMethodActive, VIDEO_isOverlayMethodActive,
+4
View File
@@ -235,6 +235,10 @@ private:
SettingCategory::Application, SettingCategory::Application,
QtInfo{ "crashRecoveryDisabled" }, QtInfo{ "crashRecoveryDisabled" },
false }, false },
BoolSettingValue{ BoolSetting::APPLICATION_enableDebug,
SettingCategory::Application,
QtInfo{ "enableDebug" },
false },
BoolSettingValue{ BoolSetting::VIDEO_brightnessEnabled, BoolSettingValue{ BoolSetting::VIDEO_brightnessEnabled,
SettingCategory::Video, SettingCategory::Video,