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

Files can be dropped to entry preview panel to attach a file again. #3135

Merged
merged 4 commits into from
Aug 20, 2017

Conversation

koppor
Copy link
Member

@koppor koppor commented Aug 19, 2017

This fixes koppor#245. The issue was caused during a code cleanup at #2723: https://github.com/JabRef/jabref/pull/2723/files#diff-093fbc56554f6c75313823ee81f28ec6L152

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?


if (t.isDataFlavorSupported(urlFlavor)) {
List<File> transferedFiles = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);
files.addAll(transferedFiles.stream().map(file -> file.toPath()).collect(Collectors.toList()));
Copy link
Member

Choose a reason for hiding this comment

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

use static reference: File::toPath

Copy link
Member

@Siedlerchr Siedlerchr Aug 19, 2017

Choose a reason for hiding this comment

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

And mabye add a comment that it has to be a File object and not a path. I remember that I fixed this before the regression and that java only recognizes this, if it is file object;)

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 19, 2017
@koppor koppor added this to the v4.0 milestone Aug 19, 2017
}

if (t.isDataFlavorSupported(urlFlavor)) {
List<File> transferedFiles = (List<File>) t.getTransferData(DataFlavor.javaFileListFlavor);
Copy link
Member

Choose a reason for hiding this comment

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

Just a nitpick, but since you're already at it could you please change this variables name from t to someting more meaningful?

Otherwise the code looks fine.

@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 20, 2017
@koppor koppor merged commit c87c527 into master Aug 20, 2017
@koppor koppor deleted the fixClassCast branch August 20, 2017 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop to preview panel does not work any more
5 participants