koppor / jabref

Collection of simple for JabRef issues. Please submit PRs to https://github.com/jabRef/jabref/.
https://github.com/jabRef/jabref/
MIT License
8 stars 13 forks source link

Refactor `TexGroup` #498

Open k3KAW8Pnf7mkmdSMPHz27 opened 3 years ago

k3KAW8Pnf7mkmdSMPHz27 commented 3 years ago

After https://github.com/JabRef/jabref/pull/7728 is merged, there will be at least three different methods resolving relative paths in the latexFileDirectory.

  1. https://github.com/JabRef/jabref/blob/bfe2679a5f3c1676dc47ab303a08726d2b4a6f12/src/main/java/org/jabref/model/groups/TexGroup.java#L139-L142
  2. https://github.com/JabRef/jabref/blob/bfe2679a5f3c1676dc47ab303a08726d2b4a6f12/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java#L437-L442
  3. https://github.com/aloofluo/jabref/blob/e7c8131996b956063eeba46a473566d83b9ed3ea/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java#L271-L273

There seems to be a need of removing most of the logic from TexGroup to prevent these kinds of issues from arising again. At the same time perhaps its dependency on the logic layer can be completely removed.

https://github.com/JabRef/jabref/blob/bfe2679a5f3c1676dc47ab303a08726d2b4a6f12/src/main/java/org/jabref/model/groups/TexGroup.java#L12-L13