1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Circles: Sort numbers at end, too

This commit is contained in:
TheSpiritXIII 2015-06-18 12:01:30 -04:00 committed by tux3
parent 79424de10a
commit 8357095d8a
2 changed files with 10 additions and 1 deletions

View File

@ -188,6 +188,10 @@ void FriendListWidget::setMode(Mode mode)
CircleWidget::getFromID(i)->setVisible(false);
}
// Only display circles once all created to avoid artifacts.
for (int i = 0; i < Settings::getInstance().getCircleCount(); ++i)
CircleWidget::getFromID(i)->setVisible(true);
QList<Friend*> friendList = FriendList::getAllFriends();
for (Friend* contact : friendList)
{

View File

@ -15,6 +15,7 @@
#include "genericchatitemlayout.h"
#include "genericchatitemwidget.h"
#include <QBoxLayout>
#include <QCollator>
#include <cassert>
// As this layout sorts widget, extra care must be taken when inserting widgets.
@ -106,7 +107,11 @@ int GenericChatItemLayout::indexOfClosestSortedWidget(GenericChatItemWidget* wid
assert(atMid != nullptr);
bool lessThan = false;
int compareValue = atMid->getName().localeAwareCompare(widget->getName());
QCollator collator;
collator.setNumericMode(true);
int compareValue = collator.compare(atMid->getName(), widget->getName());
if (compareValue < 0)
lessThan = true;