patch_manager: fix sorting of item counters >= 10

This only deals with less than 100 items (that amount is undesirable in the first place)
This commit is contained in:
Megamouse 2020-06-29 20:04:44 +02:00
parent 98eb0cd3f2
commit 372eff2d8f
1 changed files with 5 additions and 2 deletions

View File

@ -249,9 +249,12 @@ void patch_manager_dialog::populate_tree()
{
if (auto only_match = matches.count() == 1 ? matches[0] : nullptr)
{
only_match->setText(0, q_description + QStringLiteral(" (1)"));
only_match->setText(0, q_description + QStringLiteral(" (01)"));
}
visible_description += QStringLiteral(" (") + QString::number(matches.count() + 1) + QStringLiteral(")");
const int counter = matches.count() + 1;
visible_description += QStringLiteral(" (");
if (counter < 10) visible_description += '0';
visible_description += QString::number(counter) + ')';
}
QTreeWidgetItem* patch_level_item = new QTreeWidgetItem();