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

Fix attach file does not relativize file path #4252

Merged
merged 7 commits into from
Aug 10, 2018
Merged

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Aug 8, 2018

Fixes #4241

Attached files were only made relative before if you hit the browse button


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 8, 2018
Copy link
Member

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

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

Looks good to me. I've only one small suggestion to make the code more readable.

@@ -128,4 +128,12 @@ public LinkedFile getNewLinkedFile() {
return new LinkedFile(description.getValue(), link.getValue(), monadicSelectedExternalFileType.map(ExternalFileType::toString).getOrElse(""));
}

private void relativizeFile() {
Copy link
Member

Choose a reason for hiding this comment

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

Right now, it is hard to tell from the outside on which path this methods operates. I would thus prefer if relativizeFile would accept a path and return the relativized path (probably also rename to relativize[Path]). Then in would look like link.set(relativize(path)).

Copy link
Member Author

@Siedlerchr Siedlerchr Aug 8, 2018

Choose a reason for hiding this comment

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

I already had considered this option as well, but seem to have forgotten about it ;)

@Siedlerchr Siedlerchr merged commit 7b29fe3 into master Aug 10, 2018
@Siedlerchr Siedlerchr deleted the fixattachfilerelative branch August 10, 2018 09:46
Siedlerchr added a commit that referenced this pull request Aug 13, 2018
* upstream/master: (33 commits)
  Fix display of checkboxes
  Fix
  Remove Spin comments
  Fix#3861_build_addneeded/deleteobsoleteproperties2
  Fix#3861_build_addneeded/deleteobsoleteproperties
  Fix#3861_build
  Fix attach file does not relativize file path (#4252)
  Fix for issue koppor 254 (Auto cleanup url) (#4255)
  Fix#ReplaceString_ChangeConflict
  Fix#3861ReplaceString_solveConflict
  Fix#3861RS_conflicttest
  Fix#3861RS_conflicttest
  Remove changelog entries
  Fix#3861ReplaceString_checkStyle
  Fix#3861ReplaceString_Improvements
  Fix#3861ReplaceString_ContributeLog
  fix log4j slf4j dependency
  Update dependencies (#4251)
  Fix author list parser (#4169) (#4248)
  ReplaceStringMVVMPattern
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/BasePanel.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants