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

Observable preferences E (FilePreferences) #8165

Merged
merged 6 commits into from
Oct 19, 2021
Merged

Observable preferences E (FilePreferences) #8165

merged 6 commits into from
Oct 19, 2021

Conversation

calixtus
Copy link
Member

Follow up to #8142 #8164

Removed also deprecated method setFile in ParserResult

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@calixtus calixtus added preferences status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers type: code-quality Issues related to code or architecture decisions labels Oct 18, 2021
put(IMPORT_FILENAMEPATTERN, preferences.getFileNamePattern());
put(IMPORT_FILEDIRPATTERN, preferences.getFileDirectoryPattern());
putBoolean(DOWNLOAD_LINKED_FILES, preferences.shouldDownloadLinkedFiles());
EasyBind.subscribe(filePreferences.mainFileDirectoryProperty(), newValue -> put(MAIN_FILE_DIRECTORY, filePreferences.getFileDirectory().map(Path::toString).orElse("")));
Copy link
Member

Choose a reason for hiding this comment

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

Subscripe runs the lambda immediately, which leads to an unnecessary write of the preferences. Easybind.listen should be used instead. https://github.com/tobiasdiez/EasyBind#subscribe-to-values

Copy link
Member

@Siedlerchr Siedlerchr left a comment

Choose a reason for hiding this comment

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

lgm from my side. Just do what Tobias said

@calixtus
Copy link
Member Author

done

@tobiasdiez tobiasdiez merged commit f328363 into main Oct 19, 2021
@tobiasdiez tobiasdiez deleted the filePreferences branch October 19, 2021 12:36
Siedlerchr added a commit that referenced this pull request Oct 22, 2021
…idth

* upstream/main:
  Observable preferences E (FilePreferences) (#8165)
  More checkstyle fixes
  Fix checkstyle
  Remove Elsevier test
  Pass-through base URL to allow for relative URL resolution
  Use customBase also at DoiResolution (if enabled)
  Add some code comments
  Revert "Add first try to check for content type"
  Add first try to check for content type
  Add test for paywalled articles
  Change from http to https for the referrer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers type: code-quality Issues related to code or architecture decisions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants