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:
parent
79424de10a
commit
8357095d8a
|
@ -188,6 +188,10 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
CircleWidget::getFromID(i)->setVisible(false);
|
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();
|
QList<Friend*> friendList = FriendList::getAllFriends();
|
||||||
for (Friend* contact : friendList)
|
for (Friend* contact : friendList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "genericchatitemlayout.h"
|
#include "genericchatitemlayout.h"
|
||||||
#include "genericchatitemwidget.h"
|
#include "genericchatitemwidget.h"
|
||||||
#include <QBoxLayout>
|
#include <QBoxLayout>
|
||||||
|
#include <QCollator>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
// As this layout sorts widget, extra care must be taken when inserting widgets.
|
// 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);
|
assert(atMid != nullptr);
|
||||||
|
|
||||||
bool lessThan = false;
|
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)
|
if (compareValue < 0)
|
||||||
lessThan = true;
|
lessThan = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user