-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Relink moved files [Find Unlinked Files part] #13842
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
base: main
Are you sure you want to change the base?
Conversation
Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of |
jabgui/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java
Show resolved
Hide resolved
jabgui/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModelTest.java
Outdated
Show resolved
Hide resolved
jabgui/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModelTest.java
Outdated
Show resolved
Hide resolved
|
jabgui/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java
Outdated
Show resolved
Hide resolved
List<LinkedFile> filesToAdd = new ArrayList<>(); | ||
|
||
for (LinkedFile brokenLink : currentFiles) { | ||
if (brokenLink.findIn(bibDatabase, preferences.getFilePreferences()).isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just duplicated? You add all those to entriesWithBrokenLInks that are not present so why checking them again here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not all.. only entries having at least one broken link... though it could be improved thnks for letting know
jabgui/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModelTest.java
Outdated
Show resolved
Hide resolved
@Test | ||
void fixBrokenLinksInLargeDatabase(@TempDir Path tempDir) throws IOException { | ||
Path testRoot = tempDir.resolve("test"); | ||
List<BibEntry> entries = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use modern Java data structures. Instead of using new ArrayList<>(), use List.of() for creating an empty list.
jabgui/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModelTest.java
Show resolved
Hide resolved
jabgui/src/test/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModelTest.java
Show resolved
Hide resolved
Your pull request needs to link an issue correctly. To ease organizational workflows, please link this pull-request to the issue with syntax as described in https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue:
Examples
|
@trag-bot didn't find any issues in the code! ✅✨ |
Closes #9798
This PR relinks files, if it has been moved by user.
Steps to test
Mandatory checks
CHANGELOG.md
in a way that is understandable for the average user (if change is visible to the user)