Skip to content
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

Merged
merged 2 commits into from May 14, 2017
Merged

Conversation

tresf
Copy link
Member

@tresf tresf commented May 11, 2017

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.

- m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ),
+ m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave", "1" ).toInt() ),

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).

@tresf tresf added this to the 1.2.0 milestone May 11, 2017
@tresf tresf added this to In Progress in Release 1.2.0 RC3 May 11, 2017
@Umcaruje
Copy link
Member

Umcaruje commented May 13, 2017

Tested this one out.
image
After removing .lmmsrc.xml autosave and playback cursor is on 👍

Copy link
Member

@Umcaruje Umcaruje left a comment

Other than the two formatting issues, this looks good to me.

@@ -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;
Copy link
Member

@Umcaruje Umcaruje May 13, 2017

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 )

@@ -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() ),
Copy link
Member

@Umcaruje Umcaruje May 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here: "1" )

@tresf
Copy link
Member Author

tresf commented May 13, 2017

Other than the two formatting issues, this looks good to me.

Formatting issues fixed.

@tresf tresf merged commit 17b37e0 into LMMS:stable-1.2 May 14, 2017
1 check passed
@tresf tresf deleted the defaultval branch May 14, 2017
@zonkmachine zonkmachine moved this from In Progress to Done in Release 1.2.0 RC3 May 14, 2017
PhysSong pushed a commit to PhysSong/lmms that referenced this pull request Jul 8, 2017
Provide support for fallback config values

Makes autosave and some other values checked by default.  Supersedes LMMS#3541
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
Provide support for fallback config values

Makes autosave and some other values checked by default.  Supersedes LMMS#3541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants