mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Circles: Fix convention, crash and activity cycling
This commit is contained in:
parent
858b005567
commit
d9d6f20bf7
|
@ -1022,7 +1022,7 @@ QSplitter:handle{
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="searchContactText">
|
<widget class="QLineEdit" name="searchContactText">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Ignored" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1032,7 +1032,7 @@ QSplitter:handle{
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="searchContactFilterBox">
|
<widget class="QToolButton" name="searchContactFilterBox">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -1047,7 +1047,7 @@ QSplitter:handle{
|
||||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="arrowType">
|
<property name="arrowType">
|
||||||
<enum>Qt::DownArrow</enum>
|
<enum>Qt::NoArrow</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1084,7 +1084,7 @@ QSplitter:handle{
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>292</width>
|
<width>284</width>
|
||||||
<height>353</height>
|
<height>353</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -1302,7 +1302,9 @@ void Settings::setFriendCircleID(const ToxId &id, int circleID)
|
||||||
QString key = id.publicKey;
|
QString key = id.publicKey;
|
||||||
auto it = friendLst.find(key);
|
auto it = friendLst.find(key);
|
||||||
if (it != friendLst.end())
|
if (it != friendLst.end())
|
||||||
|
{
|
||||||
it->circleID = circleID;
|
it->circleID = circleID;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
friendProp fp;
|
friendProp fp;
|
||||||
|
@ -1329,7 +1331,9 @@ void Settings::setFriendActivity(const ToxId &id, const QDate &activity)
|
||||||
QString key = id.publicKey;
|
QString key = id.publicKey;
|
||||||
auto it = friendLst.find(key);
|
auto it = friendLst.find(key);
|
||||||
if (it != friendLst.end())
|
if (it != friendLst.end())
|
||||||
|
{
|
||||||
it->activity = activity;
|
it->activity = activity;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
friendProp fp;
|
friendProp fp;
|
||||||
|
|
|
@ -71,8 +71,10 @@ void CircleWidget::editName()
|
||||||
CircleWidget* CircleWidget::getFromID(int id)
|
CircleWidget* CircleWidget::getFromID(int id)
|
||||||
{
|
{
|
||||||
auto circleIt = circleList.find(id);
|
auto circleIt = circleList.find(id);
|
||||||
|
|
||||||
if (circleIt != circleList.end())
|
if (circleIt != circleList.end())
|
||||||
return circleIt.value();
|
return circleIt.value();
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +86,9 @@ void CircleWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||||
|
|
||||||
QAction* selectedItem = menu.exec(mapToGlobal(event->pos()));
|
QAction* selectedItem = menu.exec(mapToGlobal(event->pos()));
|
||||||
if (selectedItem == renameAction)
|
if (selectedItem == renameAction)
|
||||||
|
{
|
||||||
editName();
|
editName();
|
||||||
|
}
|
||||||
else if (selectedItem == removeAction)
|
else if (selectedItem == removeAction)
|
||||||
{
|
{
|
||||||
FriendListWidget* friendList = static_cast<FriendListWidget*>(parentWidget());
|
FriendListWidget* friendList = static_cast<FriendListWidget*>(parentWidget());
|
||||||
|
@ -106,6 +110,7 @@ void CircleWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
if (event->mimeData()->hasFormat("friend"))
|
if (event->mimeData()->hasFormat("friend"))
|
||||||
event->acceptProposedAction();
|
event->acceptProposedAction();
|
||||||
|
|
||||||
setContainerAttribute(Qt::WA_UnderMouse, true); // Simulate hover.
|
setContainerAttribute(Qt::WA_UnderMouse, true); // Simulate hover.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,17 +174,15 @@ void CircleWidget::updateID(int index)
|
||||||
for (int i = 0; i < friendOnlineLayout()->count(); ++i)
|
for (int i = 0; i < friendOnlineLayout()->count(); ++i)
|
||||||
{
|
{
|
||||||
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(friendOnlineLayout()->itemAt(i));
|
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(friendOnlineLayout()->itemAt(i));
|
||||||
|
|
||||||
if (friendWidget != nullptr)
|
if (friendWidget != nullptr)
|
||||||
{
|
|
||||||
Settings::getInstance().setFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId(), id);
|
Settings::getInstance().setFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId(), id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
for (int i = 0; i < friendOfflineLayout()->count(); ++i)
|
for (int i = 0; i < friendOfflineLayout()->count(); ++i)
|
||||||
{
|
{
|
||||||
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(friendOfflineLayout()->itemAt(i));
|
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(friendOfflineLayout()->itemAt(i));
|
||||||
|
|
||||||
if (friendWidget != nullptr)
|
if (friendWidget != nullptr)
|
||||||
{
|
|
||||||
Settings::getInstance().setFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId(), id);
|
Settings::getInstance().setFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId(), id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -44,11 +44,13 @@ void FriendListLayout::addFriendWidget(FriendWidget* w, Status s)
|
||||||
{
|
{
|
||||||
friendOfflineLayout.removeSortedWidget(w);
|
friendOfflineLayout.removeSortedWidget(w);
|
||||||
friendOnlineLayout.removeSortedWidget(w);
|
friendOnlineLayout.removeSortedWidget(w);
|
||||||
|
|
||||||
if (s == Status::Offline)
|
if (s == Status::Offline)
|
||||||
{
|
{
|
||||||
friendOfflineLayout.addSortedWidget(w);
|
friendOfflineLayout.addSortedWidget(w);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
friendOnlineLayout.addSortedWidget(w);
|
friendOnlineLayout.addSortedWidget(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,22 +58,27 @@ Time getTime(const QDate date)
|
||||||
return Never;
|
return Never;
|
||||||
|
|
||||||
QDate today = QDate::currentDate();
|
QDate today = QDate::currentDate();
|
||||||
|
|
||||||
if (date == today)
|
if (date == today)
|
||||||
return Today;
|
return Today;
|
||||||
|
|
||||||
today = today.addDays(-1);
|
today = today.addDays(-1);
|
||||||
|
|
||||||
if (date == today)
|
if (date == today)
|
||||||
return Yesterday;
|
return Yesterday;
|
||||||
|
|
||||||
today = today.addDays(-6);
|
today = today.addDays(-6);
|
||||||
|
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return ThisWeek;
|
return ThisWeek;
|
||||||
|
|
||||||
today = today.addDays(-today.day() + 1); // Go to the beginning of the month.
|
today = today.addDays(-today.day() + 1); // Go to the beginning of the month.
|
||||||
|
|
||||||
if (last7DaysWasLastMonth())
|
if (last7DaysWasLastMonth())
|
||||||
{
|
{
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return ThisMonth;
|
return ThisMonth;
|
||||||
|
|
||||||
today = today.addMonths(-1);
|
today = today.addMonths(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,18 +86,22 @@ Time getTime(const QDate date)
|
||||||
return Month1Ago;
|
return Month1Ago;
|
||||||
|
|
||||||
today = today.addMonths(-1);
|
today = today.addMonths(-1);
|
||||||
|
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return Month2Ago;
|
return Month2Ago;
|
||||||
|
|
||||||
today = today.addMonths(-1);
|
today = today.addMonths(-1);
|
||||||
|
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return Month3Ago;
|
return Month3Ago;
|
||||||
|
|
||||||
today = today.addMonths(-1);
|
today = today.addMonths(-1);
|
||||||
|
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return Month4Ago;
|
return Month4Ago;
|
||||||
|
|
||||||
today = today.addMonths(-1);
|
today = today.addMonths(-1);
|
||||||
|
|
||||||
if (date >= today)
|
if (date >= today)
|
||||||
return Month5Ago;
|
return Month5Ago;
|
||||||
|
|
||||||
|
@ -162,9 +171,7 @@ void FriendListWidget::setMode(Mode mode)
|
||||||
circleLayout->getLayout()->setMargin(0);
|
circleLayout->getLayout()->setMargin(0);
|
||||||
|
|
||||||
for (int i = 0; i < Settings::getInstance().getCircleCount(); ++i)
|
for (int i = 0; i < Settings::getInstance().getCircleCount(); ++i)
|
||||||
{
|
|
||||||
addCircleWidget(i);
|
addCircleWidget(i);
|
||||||
}
|
|
||||||
|
|
||||||
QList<Friend*> friendList = FriendList::getAllFriends();
|
QList<Friend*> friendList = FriendList::getAllFriends();
|
||||||
for (Friend* contact : friendList)
|
for (Friend* contact : friendList)
|
||||||
|
@ -366,12 +373,15 @@ void FriendListWidget::searchChatrooms(const QString &searchString, bool hideOnl
|
||||||
{
|
{
|
||||||
groupLayout.search(searchString, hideGroups);
|
groupLayout.search(searchString, hideGroups);
|
||||||
listLayout->searchChatrooms(searchString, hideOnline, hideOffline);
|
listLayout->searchChatrooms(searchString, hideOnline, hideOffline);
|
||||||
|
if (circleLayout != nullptr)
|
||||||
|
{
|
||||||
for (int i = 0; i != circleLayout->getLayout()->count(); ++i)
|
for (int i = 0; i != circleLayout->getLayout()->count(); ++i)
|
||||||
{
|
{
|
||||||
CircleWidget* circleWidget = static_cast<CircleWidget*>(circleLayout->getLayout()->itemAt(i)->widget());
|
CircleWidget* circleWidget = static_cast<CircleWidget*>(circleLayout->getLayout()->itemAt(i)->widget());
|
||||||
circleWidget->search(searchString, true, hideOnline, hideOffline);
|
circleWidget->search(searchString, true, hideOnline, hideOffline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void FriendListWidget::renameGroupWidget(GroupWidget* groupWidget, const QString &newName)
|
void FriendListWidget::renameGroupWidget(GroupWidget* groupWidget, const QString &newName)
|
||||||
{
|
{
|
||||||
|
@ -409,13 +419,58 @@ void FriendListWidget::cycleContacts(GenericChatroomWidget* activeChatroomWidget
|
||||||
if (activeChatroomWidget == nullptr)
|
if (activeChatroomWidget == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
int index = -1;
|
int index = -1;
|
||||||
QLayout* currentLayout = nullptr;
|
|
||||||
|
|
||||||
CircleWidget* circleWidget = nullptr;
|
|
||||||
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(activeChatroomWidget);
|
FriendWidget* friendWidget = dynamic_cast<FriendWidget*>(activeChatroomWidget);
|
||||||
|
|
||||||
|
if (mode == Activity)
|
||||||
|
{
|
||||||
|
if (friendWidget == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QDate activityDate = Settings::getInstance().getFriendActivity(FriendList::findFriend(friendWidget->friendId)->getToxId());
|
||||||
|
index = getTime(activityDate);
|
||||||
|
CategoryWidget* categoryWidget = dynamic_cast<CategoryWidget*>(activityLayout->itemAt(index)->widget());
|
||||||
|
|
||||||
|
if (categoryWidget == nullptr || categoryWidget->cycleContacts(friendWidget, forward))
|
||||||
|
return;
|
||||||
|
|
||||||
|
index += forward ? 1 : -1;
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
// Bounds checking.
|
||||||
|
if (index < Today)
|
||||||
|
{
|
||||||
|
index = Never;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (index > Never)
|
||||||
|
{
|
||||||
|
index = Today;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
CategoryWidget* categoryWidget = dynamic_cast<CategoryWidget*>(activityLayout->itemAt(index)->widget());
|
||||||
|
|
||||||
|
if (categoryWidget != nullptr)
|
||||||
|
{
|
||||||
|
if (!categoryWidget->cycleContacts(forward))
|
||||||
|
{
|
||||||
|
// Skip empty or finished categories.
|
||||||
|
index += forward ? 1 : -1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLayout* currentLayout = nullptr;
|
||||||
|
CircleWidget* circleWidget = nullptr;
|
||||||
|
|
||||||
if (friendWidget != nullptr)
|
if (friendWidget != nullptr)
|
||||||
{
|
{
|
||||||
circleWidget = CircleWidget::getFromID(Settings::getInstance().getFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId()));
|
circleWidget = CircleWidget::getFromID(Settings::getInstance().getFriendCircleID(FriendList::findFriend(friendWidget->friendId)->getToxId()));
|
||||||
|
@ -453,6 +508,7 @@ void FriendListWidget::cycleContacts(GenericChatroomWidget* activeChatroomWidget
|
||||||
}
|
}
|
||||||
|
|
||||||
index += forward ? 1 : -1;
|
index += forward ? 1 : -1;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
// Bounds checking.
|
// Bounds checking.
|
||||||
|
@ -473,8 +529,10 @@ void FriendListWidget::cycleContacts(GenericChatroomWidget* activeChatroomWidget
|
||||||
if (currentLayout == listLayout->getLayoutOnline() || currentLayout == listLayout->getLayoutOffline() || currentLayout == groupLayout.getLayout())
|
if (currentLayout == listLayout->getLayoutOnline() || currentLayout == listLayout->getLayoutOffline() || currentLayout == groupLayout.getLayout())
|
||||||
{
|
{
|
||||||
GenericChatroomWidget* chatWidget = dynamic_cast<GenericChatroomWidget*>(currentLayout->itemAt(index)->widget());
|
GenericChatroomWidget* chatWidget = dynamic_cast<GenericChatroomWidget*>(currentLayout->itemAt(index)->widget());
|
||||||
|
|
||||||
if (chatWidget != nullptr)
|
if (chatWidget != nullptr)
|
||||||
emit chatWidget->chatroomWidgetClicked(chatWidget);
|
emit chatWidget->chatroomWidgetClicked(chatWidget);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (currentLayout == circleLayout->getLayout())
|
else if (currentLayout == circleLayout->getLayout())
|
||||||
|
@ -547,6 +605,7 @@ void FriendListWidget::moveWidget(FriendWidget* w, Status s, bool add)
|
||||||
{
|
{
|
||||||
if (circleId != -1)
|
if (circleId != -1)
|
||||||
Settings::getInstance().setFriendCircleID(FriendList::findFriend(w->friendId)->getToxId(), -1);
|
Settings::getInstance().setFriendCircleID(FriendList::findFriend(w->friendId)->getToxId(), -1);
|
||||||
|
|
||||||
listLayout->addFriendWidget(w, s);
|
listLayout->addFriendWidget(w, s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -603,12 +662,14 @@ QLayout* FriendListWidget::nextLayout(QLayout* layout, bool forward) const
|
||||||
{
|
{
|
||||||
if (groupsOnTop)
|
if (groupsOnTop)
|
||||||
return listLayout->getLayoutOnline();
|
return listLayout->getLayoutOnline();
|
||||||
|
|
||||||
return listLayout->getLayoutOffline();
|
return listLayout->getLayoutOffline();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (groupsOnTop)
|
if (groupsOnTop)
|
||||||
return circleLayout->getLayout();
|
return circleLayout->getLayout();
|
||||||
|
|
||||||
return listLayout->getLayoutOnline();
|
return listLayout->getLayoutOnline();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -618,12 +679,14 @@ QLayout* FriendListWidget::nextLayout(QLayout* layout, bool forward) const
|
||||||
{
|
{
|
||||||
if (groupsOnTop)
|
if (groupsOnTop)
|
||||||
return listLayout->getLayoutOffline();
|
return listLayout->getLayoutOffline();
|
||||||
|
|
||||||
return groupLayout.getLayout();
|
return groupLayout.getLayout();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (groupsOnTop)
|
if (groupsOnTop)
|
||||||
return groupLayout.getLayout();
|
return groupLayout.getLayout();
|
||||||
|
|
||||||
return circleLayout->getLayout();
|
return circleLayout->getLayout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -633,6 +696,7 @@ QLayout* FriendListWidget::nextLayout(QLayout* layout, bool forward) const
|
||||||
return circleLayout->getLayout();
|
return circleLayout->getLayout();
|
||||||
else if (groupsOnTop)
|
else if (groupsOnTop)
|
||||||
return listLayout->getLayoutOnline();
|
return listLayout->getLayoutOnline();
|
||||||
|
|
||||||
return groupLayout.getLayout();
|
return groupLayout.getLayout();
|
||||||
}
|
}
|
||||||
else if (layout == circleLayout->getLayout())
|
else if (layout == circleLayout->getLayout())
|
||||||
|
@ -641,6 +705,7 @@ QLayout* FriendListWidget::nextLayout(QLayout* layout, bool forward) const
|
||||||
{
|
{
|
||||||
if (groupsOnTop)
|
if (groupsOnTop)
|
||||||
return groupLayout.getLayout();
|
return groupLayout.getLayout();
|
||||||
|
|
||||||
return listLayout->getLayoutOnline();
|
return listLayout->getLayoutOnline();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -96,8 +96,10 @@ void FriendWidget::contextMenuEvent(QContextMenuEvent * event)
|
||||||
circleMenu = menu.addMenu(tr("Move to circle...", "Menu to move a friend into a different circle"));
|
circleMenu = menu.addMenu(tr("Move to circle...", "Menu to move a friend into a different circle"));
|
||||||
|
|
||||||
newCircleAction = circleMenu->addAction(tr("To new circle"));
|
newCircleAction = circleMenu->addAction(tr("To new circle"));
|
||||||
|
|
||||||
if (circleId != -1)
|
if (circleId != -1)
|
||||||
removeCircleAction = circleMenu->addAction(tr("Remove from circle '%1'").arg(Settings::getInstance().getCircleName(circleId)));
|
removeCircleAction = circleMenu->addAction(tr("Remove from circle '%1'").arg(Settings::getInstance().getCircleName(circleId)));
|
||||||
|
|
||||||
circleMenu->addSeparator();
|
circleMenu->addSeparator();
|
||||||
|
|
||||||
for (int i = 0; i < Settings::getInstance().getCircleCount(); ++i)
|
for (int i = 0; i < Settings::getInstance().getCircleCount(); ++i)
|
||||||
|
|
|
@ -44,6 +44,7 @@ int GenericChatItemLayout::indexOfSortedWidget(GenericChatItemWidget* widget) co
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int index = indexOfClosestSortedWidget(widget);
|
int index = indexOfClosestSortedWidget(widget);
|
||||||
|
|
||||||
if (index >= layout->count())
|
if (index >= layout->count())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -52,6 +53,7 @@ int GenericChatItemLayout::indexOfSortedWidget(GenericChatItemWidget* widget) co
|
||||||
|
|
||||||
if (atMid == widget)
|
if (atMid == widget)
|
||||||
return index;
|
return index;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +66,7 @@ void GenericChatItemLayout::removeSortedWidget(GenericChatItemWidget* widget)
|
||||||
{
|
{
|
||||||
if (layout->isEmpty())
|
if (layout->isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int index = indexOfClosestSortedWidget(widget);
|
int index = indexOfClosestSortedWidget(widget);
|
||||||
|
|
||||||
if (layout->itemAt(index) == nullptr)
|
if (layout->itemAt(index) == nullptr)
|
||||||
|
@ -104,6 +107,7 @@ int GenericChatItemLayout::indexOfClosestSortedWidget(GenericChatItemWidget* wid
|
||||||
|
|
||||||
bool lessThan = false;
|
bool lessThan = false;
|
||||||
int compareValue = atMid->getName().localeAwareCompare(widget->getName());
|
int compareValue = atMid->getName().localeAwareCompare(widget->getName());
|
||||||
|
|
||||||
if (compareValue < 0)
|
if (compareValue < 0)
|
||||||
lessThan = true;
|
lessThan = true;
|
||||||
else if (compareValue == 0)
|
else if (compareValue == 0)
|
||||||
|
|
|
@ -137,10 +137,9 @@ void CroppingLabel::minimizeMaximumWidth()
|
||||||
void CroppingLabel::editingFinished()
|
void CroppingLabel::editingFinished()
|
||||||
{
|
{
|
||||||
QString newText = textEdit->text().trimmed().remove(QRegExp("[\\t\\n\\v\\f\\r\\x0000]"));
|
QString newText = textEdit->text().trimmed().remove(QRegExp("[\\t\\n\\v\\f\\r\\x0000]"));
|
||||||
|
|
||||||
if (origText != newText)
|
if (origText != newText)
|
||||||
{
|
|
||||||
emit editFinished(textEdit->text());
|
emit editFinished(textEdit->text());
|
||||||
}
|
|
||||||
|
|
||||||
textEdit->hide();
|
textEdit->hide();
|
||||||
blockPaintEvents = false;
|
blockPaintEvents = false;
|
||||||
|
|
|
@ -1412,12 +1412,12 @@ void Widget::reloadTheme()
|
||||||
|
|
||||||
void Widget::nextContact()
|
void Widget::nextContact()
|
||||||
{
|
{
|
||||||
cycleContacts(1);
|
cycleContacts(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::previousContact()
|
void Widget::previousContact()
|
||||||
{
|
{
|
||||||
cycleContacts(-1);
|
cycleContacts(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Widget::getStatusIconPath(Status status)
|
QString Widget::getStatusIconPath(Status status)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user