mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
cleanup setting.ini file after a fiend removing
This commit is contained in:
parent
dfd6420ddc
commit
07ea2e0828
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "friend.h"
|
||||
#include "friendlist.h"
|
||||
#include "src/misc/settings.h"
|
||||
#include <QMenu>
|
||||
#include <QDebug>
|
||||
#include <QHash>
|
||||
|
@ -49,7 +50,10 @@ void FriendList::removeFriend(int friendId)
|
|||
{
|
||||
auto f_it = friendList.find(friendId);
|
||||
if (f_it != friendList.end())
|
||||
{
|
||||
Settings::getInstance().removeFriendSettings(f_it.value()->getToxID());
|
||||
friendList.erase(f_it);
|
||||
}
|
||||
}
|
||||
|
||||
void FriendList::clear()
|
||||
|
|
|
@ -857,6 +857,12 @@ void Settings::setFriendAlias(const ToxID &id, const QString &alias)
|
|||
}
|
||||
}
|
||||
|
||||
void Settings::removeFriendSettings(const ToxID &id)
|
||||
{
|
||||
QString key = id.publicKey;
|
||||
friendLst.remove(key);
|
||||
}
|
||||
|
||||
bool Settings::getFauxOfflineMessaging() const
|
||||
{
|
||||
return fauxOfflineMessaging;
|
||||
|
|
|
@ -199,6 +199,8 @@ public:
|
|||
QString getFriendAlias(const ToxID &id) const;
|
||||
void setFriendAlias(const ToxID &id, const QString &alias);
|
||||
|
||||
void removeFriendSettings(const ToxID &id);
|
||||
|
||||
bool getFauxOfflineMessaging() const;
|
||||
void setFauxOfflineMessaging(bool value);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user