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

Supercedes #3541
@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 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;

This comment has been minimized.

Copy link
@Umcaruje

Umcaruje May 13, 2017

Member

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() ),

This comment has been minimized.

Copy link
@Umcaruje

Umcaruje May 13, 2017

Member

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
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tresf tresf deleted the tresf:defaultval branch May 14, 2017
@zonkmachine zonkmachine moved this from In Progress to Done in Release 1.2.0 RC3 May 14, 2017
PhysSong added 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.