| 90 | } |
| 91 | |
| 92 | bool BibTeXEntryLessThan(const BibTeXFile::Entry * a, const BibTeXFile::Entry * b) |
| 93 | { |
| 94 | Q_ASSERT(a); |
| 95 | Q_ASSERT(b); |
| 96 | |
| 97 | // Sort by year first |
| 98 | if (a->year() != b->year()) { |
| 99 | if (a->year().isEmpty() && !b->year().isEmpty()) return false; |
| 100 | if (!a->year().isEmpty() && b->year().isEmpty()) return true; |
| 101 | return a->year() < b->year(); |
| 102 | } |
| 103 | // If the years are equal, sort by authors |
| 104 | if (a->author() != b->author()) |
| 105 | return a->author() < b->author(); |
| 106 | // if (a->title() != b->title()) |
| 107 | // return a->title() < b->title(); |
| 108 | |
| 109 | // If all else fails, sort by BibTeX key |
| 110 | return a->key() < b->key(); |
| 111 | } |
| 112 | |
| 113 | QStringList CitationSelectDialog::getSelectedKeys(const bool ordered /* = true */) const |
| 114 | { |