1
0
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:
apprb 2014-11-12 01:52:19 +09:00
parent dfd6420ddc
commit 07ea2e0828
No known key found for this signature in database
GPG Key ID: B001911B5B22FB9B
3 changed files with 12 additions and 0 deletions

View File

@ -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()

View File

@ -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;

View File

@ -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);