mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
22732b6f79
commit
359a42f78e
@ -314,8 +314,8 @@ void AddFriendForm::onFriendRequestAccepted()
|
|||||||
QPushButton* acceptButton = static_cast<QPushButton*>(sender());
|
QPushButton* acceptButton = static_cast<QPushButton*>(sender());
|
||||||
QWidget* friendWidget = acceptButton->parentWidget();
|
QWidget* friendWidget = acceptButton->parentWidget();
|
||||||
const int index = requestsLayout->indexOf(friendWidget);
|
const int index = requestsLayout->indexOf(friendWidget);
|
||||||
const int indexFromEnd = requestsLayout->count() - index - 1;
|
|
||||||
removeFriendRequestWidget(friendWidget);
|
removeFriendRequestWidget(friendWidget);
|
||||||
|
const int indexFromEnd = requestsLayout->count() - index - 1;
|
||||||
const Settings::Request request = Settings::getInstance().getFriendRequest(indexFromEnd);
|
const Settings::Request request = Settings::getInstance().getFriendRequest(indexFromEnd);
|
||||||
emit friendRequestAccepted(ToxId(request.address).getPublicKey());
|
emit friendRequestAccepted(ToxId(request.address).getPublicKey());
|
||||||
Settings::getInstance().removeFriendRequest(indexFromEnd);
|
Settings::getInstance().removeFriendRequest(indexFromEnd);
|
||||||
@ -327,8 +327,8 @@ void AddFriendForm::onFriendRequestRejected()
|
|||||||
QPushButton* rejectButton = static_cast<QPushButton*>(sender());
|
QPushButton* rejectButton = static_cast<QPushButton*>(sender());
|
||||||
QWidget* friendWidget = rejectButton->parentWidget();
|
QWidget* friendWidget = rejectButton->parentWidget();
|
||||||
const int index = requestsLayout->indexOf(friendWidget);
|
const int index = requestsLayout->indexOf(friendWidget);
|
||||||
const int indexFromEnd = requestsLayout->count() - index - 1;
|
|
||||||
removeFriendRequestWidget(friendWidget);
|
removeFriendRequestWidget(friendWidget);
|
||||||
|
const int indexFromEnd = requestsLayout->count() - index - 1;
|
||||||
Settings::getInstance().removeFriendRequest(indexFromEnd);
|
Settings::getInstance().removeFriendRequest(indexFromEnd);
|
||||||
Settings::getInstance().savePersonal();
|
Settings::getInstance().savePersonal();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user