Skip to content

Commit

Permalink
put renaming of file entries in JavaFX thread for cleanup (#4818)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0light authored and tobiasdiez committed Mar 28, 2019
1 parent 133fbaa commit a9115a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/jabref/logic/cleanup/RenamePdfCleanup.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Objects;
import java.util.Optional;

import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.logic.externalfiles.LinkedFileHandler;
import org.jabref.model.FieldChange;
import org.jabref.model.cleanup.CleanupJob;
Expand Down Expand Up @@ -54,8 +55,8 @@ public List<FieldChange> cleanup(BibEntry entry) {
}

if (changed) {
Optional<FieldChange> changes = entry.setFiles(files);
return OptionalUtil.toList(changes);
Optional<FieldChange> fileFieldChanged = DefaultTaskExecutor.runInJavaFXThread(() -> entry.setFiles(files));
return OptionalUtil.toList(fileFieldChanged);
}

return Collections.emptyList();
Expand Down

0 comments on commit a9115a2

Please sign in to comment.