Skip to content

Commit

Permalink
Fixed secondary sorting not working for some special fields (#7409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fu188 authored Feb 1, 2021
1 parent 8c3424c commit c951877
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the password for a shared SQL database was only remembered if it was the same as the username [#6869](https://github.com/JabRef/jabref/issues/6869)
- We fixed an issue where alt+keyboard shortcuts do not work [#6994](https://github.com/JabRef/jabref/issues/6994)
- We fixed an issue where the file path is invisible in dark theme. [#7382](https://github.com/JabRef/jabref/issues/7382)
- We fixed an issue where the secondary sorting is not working for some special fields. [#7015](https://github.com/JabRef/jabref/issues/7015)
- We fixed an issue where changing the font size makes the font size field too small. [#7085](https://github.com/JabRef/jabref/issues/7085)

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import org.jabref.gui.specialfields.SpecialFieldViewModel;
import org.jabref.gui.specialfields.SpecialFieldsPreferences;
import org.jabref.gui.util.OptionalValueTableCellFactory;
import org.jabref.gui.util.comparator.PriorityFieldComparator;
import org.jabref.gui.util.comparator.RankingFieldComparator;
import org.jabref.gui.util.comparator.ReadStatusFieldComparator;
import org.jabref.gui.util.comparator.SpecialFieldComparator;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.FieldFactory;
import org.jabref.model.entry.field.SpecialField;
Expand Down Expand Up @@ -83,15 +82,8 @@ public SpecialFieldColumn(MainTableColumnModel model, PreferencesService prefere

if (specialField == SpecialField.RANKING) {
this.setComparator(new RankingFieldComparator());
}

// Added comparator for Read Status
if (specialField == SpecialField.READ_STATUS) {
this.setComparator(new ReadStatusFieldComparator());
}

if (specialField == SpecialField.PRIORITY) {
this.setComparator(new PriorityFieldComparator());
} else {
this.setComparator(new SpecialFieldComparator());
}

this.setSortable(true);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import org.jabref.gui.specialfields.SpecialFieldValueViewModel;

public class PriorityFieldComparator implements Comparator<Optional<SpecialFieldValueViewModel>> {
public class SpecialFieldComparator implements Comparator<Optional<SpecialFieldValueViewModel>> {

@Override
public int compare(Optional<SpecialFieldValueViewModel> val1, Optional<SpecialFieldValueViewModel> val2) {
Expand Down

0 comments on commit c951877

Please sign in to comment.