mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(group): Replace 'renameRequest' signal on Group::titleChanged
This commit is contained in:
parent
11e75104f4
commit
4fee43cded
|
@ -23,8 +23,9 @@
|
|||
#include "friendwidget.h"
|
||||
#include "groupwidget.h"
|
||||
#include "widget.h"
|
||||
#include "src/model/friend.h"
|
||||
#include "src/friendlist.h"
|
||||
#include "src/model/friend.h"
|
||||
#include "src/model/group.h"
|
||||
#include "src/persistence/settings.h"
|
||||
#include <QDragEnterEvent>
|
||||
#include <QDragLeaveEvent>
|
||||
|
@ -279,7 +280,11 @@ FriendListWidget::Mode FriendListWidget::getMode() const
|
|||
void FriendListWidget::addGroupWidget(GroupWidget* widget)
|
||||
{
|
||||
groupLayout.addSortedWidget(widget);
|
||||
connect(widget, &GroupWidget::renameRequested, this, &FriendListWidget::renameGroupWidget);
|
||||
Group* g = widget->getGroup();
|
||||
connect(g, &Group::titleChanged, [=](uint32_t groupId, const QString& name) {
|
||||
Q_UNUSED(groupId);
|
||||
renameGroupWidget(widget, name);
|
||||
});
|
||||
}
|
||||
|
||||
void FriendListWidget::addFriendWidget(FriendWidget* w, Status s, int circleIndex)
|
||||
|
|
|
@ -66,7 +66,6 @@ void GroupWidget::setTitle(const QString& newName)
|
|||
if (!newName.isEmpty()) {
|
||||
Group* g = GroupList::findGroup(groupId);
|
||||
g->setName(newName);
|
||||
emit renameRequested(this, newName);
|
||||
emit g->getChatForm()->groupTitleChanged(groupId, newName.left(128));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ public:
|
|||
|
||||
signals:
|
||||
void groupWidgetClicked(GroupWidget* widget);
|
||||
void renameRequested(GroupWidget* widget, const QString& newName);
|
||||
void removeGroup(int groupId);
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in New Issue
Block a user