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(); m_customTickRateMs = value.toInt();
} }
} }
value = appSettings()->value( "debugState", m_debugState );
if ( value.isValid() && !value.isNull() )
{
m_debugState = value.toInt();
}
appSettings()->endGroup(); appSettings()->endGroup();
// Grab local version number // Grab local version number
@@ -821,23 +816,16 @@ void OverlayController::setVersionCheckText( QString value, bool notify )
int OverlayController::debugState() const int OverlayController::debugState() const
{ {
return m_debugState; return settings::getSetting( settings::IntSetting::APPLICATION_debugState );
} }
void OverlayController::setDebugState( int value, bool notify ) void OverlayController::setDebugState( int value, bool notify )
{ {
if ( m_debugState == value ) settings::setSetting( settings::IntSetting::APPLICATION_debugState, value );
{
return;
}
m_debugState = value;
appSettings()->beginGroup( "applicationSettings" );
appSettings()->setValue( "debugState", m_debugState );
appSettings()->endGroup();
appSettings()->sync();
if ( notify ) if ( notify )
{ {
emit debugStateChanged( m_debugState ); emit debugStateChanged( value );
} }
} }
-1
View File
@@ -123,7 +123,6 @@ private:
bool m_noSound; bool m_noSound;
bool m_newVersionDetected = false; bool m_newVersionDetected = false;
int m_customTickRateMs = 20; int m_customTickRateMs = 20;
int m_debugState = 0;
int m_remoteVersionMajor = -1; int m_remoteVersionMajor = -1;
int m_remoteVersionMinor = -1; int m_remoteVersionMinor = -1;
int m_remoteVersionPatch = -1; int m_remoteVersionPatch = -1;
+2
View File
@@ -81,6 +81,8 @@ enum class IntSetting
PLAYSPACE_dragComfortFactor, PLAYSPACE_dragComfortFactor,
PLAYSPACE_turnComfortFactor, PLAYSPACE_turnComfortFactor,
APPLICATION_debugState,
UTILITY_alarmHour, UTILITY_alarmHour,
UTILITY_alarmMinute, UTILITY_alarmMinute,
// LAST_ENUMERATOR must always be set to the last value // LAST_ENUMERATOR must always be set to the last value
+5
View File
@@ -376,6 +376,11 @@ private:
QtInfo{ "turnComfortFactor" }, QtInfo{ "turnComfortFactor" },
0 }, 0 },
IntSettingValue{ IntSetting::APPLICATION_debugState,
SettingCategory::Application,
QtInfo{ "debugState" },
0 },
IntSettingValue{ IntSetting::UTILITY_alarmHour, IntSettingValue{ IntSetting::UTILITY_alarmHour,
SettingCategory::Utility, SettingCategory::Utility,
QtInfo{ "alarmHour" }, QtInfo{ "alarmHour" },