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

ExternalFileTypes singleton refactor #9044

Merged
merged 14 commits into from
Aug 12, 2022
Merged

ExternalFileTypes singleton refactor #9044

merged 14 commits into from
Aug 12, 2022

Conversation

calixtus
Copy link
Member

@calixtus calixtus commented Aug 11, 2022

Made methods in ExternalFileTypes static, moved data holder to preferences and extracted the singleton.
Added tests 🎉 .

  • 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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • 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.

# Conflicts:
#	src/main/java/org/jabref/gui/JabRefFrame.java
#	src/main/java/org/jabref/gui/LibraryTab.java
#	src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java
#	src/main/java/org/jabref/gui/importer/GenerateEntryFromIdAction.java
#	src/main/java/org/jabref/gui/maintable/MainTable.java
@calixtus calixtus marked this pull request as ready for review August 11, 2022 15:23
@calixtus calixtus added 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 external files labels Aug 11, 2022
return extension.flatMap(ext -> getExternalFileTypeByExt(ext, filePreferences));
}

public static Optional<ExternalFileType> getExternalFileTypeByLinkedFile(LinkedFile linkedFile, boolean deduceUnknownType, FilePreferences filePreferences) {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it "deduct" instead of "deduce"?

Copy link
Member Author

Choose a reason for hiding this comment

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

dunno, didnt modify it, just copied it around...

Copy link
Member

Choose a reason for hiding this comment

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

deduce is correct here

@Siedlerchr Siedlerchr merged commit 507a263 into main Aug 12, 2022
@Siedlerchr Siedlerchr deleted the refactor-eft branch August 12, 2022 12:22
Siedlerchr added a commit that referenced this pull request Aug 12, 2022
…ledgeItems

* upstream/main:
  Fixed table update in eft preferences (#9051)
  Keep EOL setting at backups (#9048)
  ExternalFileTypes singleton refactor (#9044)
  Fix dead link (#9047)
  Fix performance regresssion (#9045)

# Conflicts:
#	CHANGELOG.md
Siedlerchr added a commit to koppor/jabref that referenced this pull request Aug 14, 2022
* upstream/main: (31 commits)
  Citavi Importer - Import all knowledge items (JabRef#9043)
  Fixed table update in eft preferences (JabRef#9051)
  Keep EOL setting at backups (JabRef#9048)
  ExternalFileTypes singleton refactor (JabRef#9044)
  Fix dead link (JabRef#9047)
  Fix performance regresssion (JabRef#9045)
  Update javafx to 18.02
  import citavi knowledge items (JabRef#9033)
  Fix .gitattributes for CHANGELOG.md
  [GSOC22] - B - Implement merging fields in the three way merge UI (JabRef#9022)
  [GSOC22] - A - Implement a fully functional three way merge UI (JabRef#8945)
  Change button label from "Return to JabRef" to "Return to library" (JabRef#9039)
  Bump postgresql from 42.4.0 to 42.4.1 (JabRef#9036)
  Bump org.javamodularity.moduleplugin from 1.8.11 to 1.8.12 (JabRef#9037)
  Bump slf4j-api from 2.0.0-alpha7 to 2.0.0-beta1 (JabRef#9035)
  Bump slf4j-api from 2.0.0-alpha7 to 2.0.0-beta1 in /buildSrc (JabRef#9038)
  Update Gradle Wrapper from 7.5 to 7.5.1. (JabRef#9034)
  Refactor of DOI import failure dialog, import format reader and clipboard manager (JabRef#8839)
  Snapcraft and issue template
  Show development information\n\n+semver: minor
  ...
Siedlerchr added a commit that referenced this pull request Aug 21, 2022
* upstream/main:
  Citavi Importer - Import all knowledge items (#9043)
  Fixed table update in eft preferences (#9051)
  Keep EOL setting at backups (#9048)
  ExternalFileTypes singleton refactor (#9044)
  Fix dead link (#9047)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external files 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.

3 participants