Skip to content

Commit

Permalink
Fix sorting for additional pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Mar 9, 2024
1 parent cb15f46 commit 6eeaa36
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/list/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ void List::Library::onExpanded(QTreeWidgetItem *item)

void List::Library::itemsLoaded(std::vector<ListItem::Library> &items, QTreeWidgetItem *item)
{
std::sort(items.begin(), items.end(),
[](const ListItem::Library &item1, const ListItem::Library &item2) -> bool
{
return item1.name() < item2.name();
}
);

// No results
if (items.empty())
{
Expand All @@ -284,6 +277,8 @@ void List::Library::itemsLoaded(std::vector<ListItem::Library> &items, QTreeWidg
child->setData(0, dataRole, result.data());
item->addChild(child);
}

item->sortChildren(0, Qt::AscendingOrder);
}

void List::Library::onMenuRequested(const QPoint &pos)
Expand Down

0 comments on commit 6eeaa36

Please sign in to comment.