mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: Remove chatForm from Friend
This commit is contained in:
parent
b26255703d
commit
42a3a27a58
@ -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)
|
void Friend::setName(const QString& _name)
|
||||||
{
|
{
|
||||||
QString name = _name;
|
QString name = _name;
|
||||||
@ -124,13 +119,3 @@ Status Friend::getStatus() const
|
|||||||
{
|
{
|
||||||
return friendStatus;
|
return friendStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatForm* Friend::getChatForm() const
|
|
||||||
{
|
|
||||||
return chatForm;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Friend::setChatForm(ChatForm* form)
|
|
||||||
{
|
|
||||||
chatForm = form;
|
|
||||||
}
|
|
||||||
|
@ -26,15 +26,12 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class ChatForm;
|
|
||||||
|
|
||||||
class Friend : public Contact
|
class Friend : public Contact
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Friend(uint32_t friendId, const ToxPk& friendPk, const QString& userAlias);
|
Friend(uint32_t friendId, const ToxPk& friendPk, const QString& userAlias);
|
||||||
Friend(const Friend& other) = delete;
|
Friend(const Friend& other) = delete;
|
||||||
~Friend() override;
|
|
||||||
Friend& operator=(const Friend& other) = delete;
|
Friend& operator=(const Friend& other) = delete;
|
||||||
|
|
||||||
void setName(const QString& name) override;
|
void setName(const QString& name) override;
|
||||||
@ -54,9 +51,6 @@ public:
|
|||||||
void setStatus(Status s);
|
void setStatus(Status s);
|
||||||
Status getStatus() const;
|
Status getStatus() const;
|
||||||
|
|
||||||
ChatForm* getChatForm() const;
|
|
||||||
void setChatForm(ChatForm* form);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void nameChanged(uint32_t friendId, const QString& name);
|
void nameChanged(uint32_t friendId, const QString& name);
|
||||||
void aliasChanged(uint32_t friendId, QString alias);
|
void aliasChanged(uint32_t friendId, QString alias);
|
||||||
@ -74,8 +68,6 @@ private:
|
|||||||
uint32_t friendId;
|
uint32_t friendId;
|
||||||
bool hasNewEvents;
|
bool hasNewEvents;
|
||||||
Status friendStatus;
|
Status friendStatus;
|
||||||
|
|
||||||
ChatForm* chatForm;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FRIEND_H
|
#endif // FRIEND_H
|
||||||
|
@ -523,6 +523,10 @@ Widget::~Widget()
|
|||||||
removeFriend(f, true);
|
removeFriend(f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto form : chatForms) {
|
||||||
|
delete form;
|
||||||
|
}
|
||||||
|
|
||||||
delete icon;
|
delete icon;
|
||||||
delete profileForm;
|
delete profileForm;
|
||||||
delete addFriendForm;
|
delete addFriendForm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user