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

PDFs are not stored next to .bib file if file directory is configured #9113

Merged
merged 21 commits into from
Sep 3, 2022

Conversation

koppor
Copy link
Member

@koppor koppor commented Sep 1, 2022

We had following issue:

  • database file directory is configured outside the .bib directory
  • .bib file is versioned
  • .bib file is shared among a research group
  • a user constantly adds PDFs into the git repository

Inspecting the code, the reason probably is that the database file directory is accessible on Windows only, but not on Mac OS X. Thus, during download, JabRef did a fallback on the directory of the .bib file.

This PR fixes it:

  • In case a directory is set for a database, the fallback is NOT the directory of the .bib file, but the globally configured directory
  • The globally configured directory is empty per default. The new default is the user's home + JabRef sub directory:
    Snipaste_2022-09-01_23-49-52

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

@Siedlerchr
Copy link
Member

How does this correlate with the Checkbox ticked "Search and store files relative to the bib library directory?"
=> If all direcroties are empty and this is checked then the file should be stored next to the bib file

@koppor
Copy link
Member Author

koppor commented Sep 2, 2022

How does this correlate with the Checkbox ticked "Search and store files relative to the bib library directory?" => If all direcroties are empty and this is checked then the file should be stored next to the bib file

This is the long description of following new (!) code:

   if (fileDirs.isEmpty() && preferences.shouldStoreFilesRelativeToBibFile()) {

Should I add this as text or would it be clear from the code itself?

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 2, 2022
@calixtus
Copy link
Member

calixtus commented Sep 3, 2022

Major problem: swing reintroduced in JabRefPreferences, architecture tests are failing and future modularization is at risk

@Siedlerchr
Copy link
Member

Deciscions: Move to OS or Desktop class

…-user-directory-first

* upstream/main:
  fix l10n
  Compile fix
  Fix parsing of JabRef v5.7 study.yml files (#9124)
  Fix integrity check  for tilde accents in author names (#9097)
  Rework the Define study parameters dialog (#9123)

# Conflicts:
#	CHANGELOG.md
@Siedlerchr
Copy link
Member

CleanupWorker fails cleanupRenamePdfRenamesRelativeFile and cleanupRelativePathsConvertAbsoluteToRelativePath

@Siedlerchr Siedlerchr merged commit 4685800 into main Sep 3, 2022
@Siedlerchr Siedlerchr deleted the download-should-use-user-directory-first branch September 3, 2022 19:58
Siedlerchr added a commit that referenced this pull request Sep 4, 2022
* upstream/main:
  Fix link and remove obsolete FAQ
  Rename 'Close' to 'Cancel' in the External Changes Resolver dialog (#9130)
  Tiny rephrasing
  Linked files with an absolute path can be opened again (#9129)
  Oberservable Preferences M (CleanupPreferences) (#9126)
  fix broken link
  Fix broken link
  Fix old JabRef linked files containing the file directory as element in the filename (#9046)
  PDFs are not stored next to .bib file if file directory is configured (#9113)
  Remove double stateManager.activeDatabaseProperty() (#9127)
  Don't show the info button when the authors field content is identical (#9128)
Siedlerchr added a commit to LIM0000/jabref that referenced this pull request Sep 4, 2022
* upstream/main: (111 commits)
  Fix link and remove obsolete FAQ
  Rename 'Close' to 'Cancel' in the External Changes Resolver dialog (JabRef#9130)
  Tiny rephrasing
  Linked files with an absolute path can be opened again (JabRef#9129)
  Oberservable Preferences M (CleanupPreferences) (JabRef#9126)
  fix broken link
  Fix broken link
  Fix old JabRef linked files containing the file directory as element in the filename (JabRef#9046)
  PDFs are not stored next to .bib file if file directory is configured (JabRef#9113)
  Remove double stateManager.activeDatabaseProperty() (JabRef#9127)
  Don't show the info button when the authors field content is identical (JabRef#9128)
  "study.yml" is static now (JabRef#9125)
  fix l10n
  Compile fix
  Fix parsing of JabRef v5.7 study.yml files (JabRef#9124)
  Fix integrity check  for tilde accents in author names (JabRef#9097)
  Rework the Define study parameters dialog (JabRef#9123)
  Fix parsing of save actions (JabRef#9122)
  Fix exception that occurs when saving name formatters (JabRef#9121)
  Refine code for BibEntry#replaceDownloadedFile (JabRef#9118)
  ...
@calixtus calixtus added the jabcon label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jabcon status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants