Browse Source

refactor: remove unused functions detected by cppcheck

Note: Some more functions were detected, but this are the ones I'm
pretty sure we don't need.
reviewable/pr5612/r2
sudden6 6 years ago
parent
commit
229ca307cf
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 40
      src/widget/widget.cpp
  2. 3
      src/widget/widget.h

40
src/widget/widget.cpp

@ -1213,16 +1213,6 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message, bool @@ -1213,16 +1213,6 @@ void Widget::onFriendMessageReceived(int friendId, const QString& message, bool
newFriendMessageAlert(friendId);
}
void Widget::onReceiptRecieved(int friendId, ReceiptNum receipt)
{
Friend* f = FriendList::findFriend(friendId);
if (!f) {
return;
}
chatForms[friendId]->getOfflineMsgEngine()->onReceiptReceived(receipt);
}
void Widget::addFriendDialog(const Friend* frnd, ContentDialog* dialog)
{
uint32_t friendId = frnd->getId();
@ -1551,21 +1541,6 @@ void Widget::removeFriend(int friendId) @@ -1551,21 +1541,6 @@ void Widget::removeFriend(int friendId)
removeFriend(FriendList::findFriend(friendId), false);
}
void Widget::clearContactsList()
{
assert(QThread::currentThread() == qApp->thread());
QList<Friend*> friends = FriendList::getAllFriends();
for (Friend* f : friends) {
removeFriend(f, true);
}
QList<Group*> groups = GroupList::getAllGroups();
for (Group* g : groups) {
removeGroup(g, true);
}
}
void Widget::onDialogShown(GenericChatroomWidget* widget)
{
widget->resetEventFlags();
@ -2355,21 +2330,6 @@ void Widget::searchCircle(CircleWidget* circleWidget) @@ -2355,21 +2330,6 @@ void Widget::searchCircle(CircleWidget* circleWidget)
circleWidget->search(text, true, filterOnline(filter), filterOffline(filter));
}
void Widget::searchItem(GenericChatItemWidget* chatItem, GenericChatItemWidget::ItemType type)
{
bool hide;
FilterCriteria filter = getFilterCriteria();
switch (type) {
case GenericChatItemWidget::GroupItem:
hide = filterGroups(filter);
break;
default:
hide = true;
}
chatItem->searchName(ui->searchContactText->text(), hide);
}
bool Widget::groupsVisible() const
{
FilterCriteria filter = getFilterCriteria();

3
src/widget/widget.h

@ -122,7 +122,6 @@ public: @@ -122,7 +122,6 @@ public:
bool newGroupMessageAlert(int groupId, bool notify);
bool getIsWindowMinimized();
void updateIcons();
void clearContactsList();
static QString fromDialogType(DialogType type);
ContentDialog* createContentDialog() const;
@ -141,7 +140,6 @@ public: @@ -141,7 +140,6 @@ public:
static Status getStatusFromString(QString status);
void searchCircle(CircleWidget* circleWidget);
void searchItem(GenericChatItemWidget* chatItem, GenericChatItemWidget::ItemType type);
bool groupsVisible() const;
void resetIcon();
@ -170,7 +168,6 @@ public slots: @@ -170,7 +168,6 @@ public slots:
void onFriendMessageReceived(int friendId, const QString& message, bool isAction);
void onFriendRequestReceived(const ToxPk& friendPk, const QString& message);
void updateFriendActivity(const Friend* frnd);
void onReceiptRecieved(int friendId, ReceiptNum receipt);
void onEmptyGroupCreated(int groupId, const QString& title);
void onGroupInviteReceived(const GroupInvite& inviteInfo);
void onGroupInviteAccepted(const GroupInvite& inviteInfo);

Loading…
Cancel
Save