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

Set all default settings at the beginning #5503

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Jan 28, 2021

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

I noticed NewPipe does not call PreferenceManager.setDefaultValues() for all settings screens. This PR fixes this, by adding notification_settings and update_settings.

Fixes the following issue(s)

Probably not doing this didn't cause any issue, since there are always fallbacks when getting preferences, but it surely does not hurt.

Due diligence

@Stypox Stypox added the codequality Improvements to the codebase to improve the code quality label Jan 28, 2021
@XiangRongLin
Copy link
Collaborator

To help my understanding: This method just saves the default values from the xml into the PreferenceManager? The method does not set the value to the default value? Meaning for each preference 2 values are saved, one being the current value and one the default value?

@Stypox
Copy link
Member Author

Stypox commented Jan 29, 2021

@XiangRongLin no, that method checks for each of the defaultValues defined in in the xml if their corresponding key has already a value inside the shared preferences. If it has one, nothing is done (the setting was already changed or the default was already set), otherwise the value corresponding to that key is set to the default value.

@Stypox Stypox merged commit 3829565 into TeamNewPipe:dev Jan 29, 2021
tossj pushed a commit to tossj/NewPipe-legacy that referenced this pull request Apr 21, 2021
@Stypox Stypox deleted the settings-default branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants