-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide support for fallback config values #3551
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the two formatting issues, this looks good to me.
include/ConfigManager.h
Outdated
@@ -217,6 +217,9 @@ class EXPORT ConfigManager | |||
|
|||
const QString & value( const QString & cls, | |||
const QString & attribute ) const; | |||
const QString & value( const QString & cls, | |||
const QString & attribute, | |||
const QString & defaultVal) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should have a space between the parenthesis : defaultVal )
src/gui/SetupDialog.cpp
Outdated
@@ -131,7 +131,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : | |||
m_syncVSTPlugins( ConfigManager::inst()->value( "ui", | |||
"syncvstplugins" ).toInt() ), | |||
m_animateAFP(ConfigManager::inst()->value( "ui", | |||
"animateafp").toInt() ), | |||
"animateafp", "1").toInt() ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here: "1" )
Formatting issues fixed. |
Provide support for fallback config values Makes autosave and some other values checked by default. Supersedes LMMS#3541
Provide support for fallback config values Makes autosave and some other values checked by default. Supersedes LMMS#3541
Supersedes #3541 to address autosave regression #181 (comment).
Previous to this PR, there was no way to provide a "default on" style config value. The effect of this was variable names such as
disableautosave
causing double negatives in our codebase making it hard to read. Attempts to change them have resulted in a mismatch between desired default and actual default. This should allow config values to have default values.e.g.
Booleans are parsed as integers. A default value of
1
will make a checkbox true. This will allow us to start moving toward more properly named variables as explained very well here #3088 (comment).