diff --git a/src/model/friend.cpp b/src/model/friend.cpp index d04a8f91d..2da20ebf2 100644 --- a/src/model/friend.cpp +++ b/src/model/friend.cpp @@ -39,11 +39,6 @@ Friend::Friend(uint32_t friendId, const ToxPk& friendPk, const QString& userAlia } } -Friend::~Friend() -{ - delete chatForm; -} - void Friend::setName(const QString& _name) { QString name = _name; @@ -124,13 +119,3 @@ Status Friend::getStatus() const { return friendStatus; } - -ChatForm* Friend::getChatForm() const -{ - return chatForm; -} - -void Friend::setChatForm(ChatForm* form) -{ - chatForm = form; -} diff --git a/src/model/friend.h b/src/model/friend.h index 416551f57..eed54e51c 100644 --- a/src/model/friend.h +++ b/src/model/friend.h @@ -26,15 +26,12 @@ #include #include -class ChatForm; - class Friend : public Contact { Q_OBJECT public: Friend(uint32_t friendId, const ToxPk& friendPk, const QString& userAlias); Friend(const Friend& other) = delete; - ~Friend() override; Friend& operator=(const Friend& other) = delete; void setName(const QString& name) override; @@ -54,9 +51,6 @@ public: void setStatus(Status s); Status getStatus() const; - ChatForm* getChatForm() const; - void setChatForm(ChatForm* form); - signals: void nameChanged(uint32_t friendId, const QString& name); void aliasChanged(uint32_t friendId, QString alias); @@ -74,8 +68,6 @@ private: uint32_t friendId; bool hasNewEvents; Status friendStatus; - - ChatForm* chatForm; }; #endif // FRIEND_H diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 6a478c477..9c8c127ed 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -523,6 +523,10 @@ Widget::~Widget() removeFriend(f, true); } + for (auto form : chatForms) { + delete form; + } + delete icon; delete profileForm; delete addFriendForm;