mirror-chatterino2/usermanager.h
hemirt 744940ffd5 windowmanager destructor free _mainwindow, fix save - remove const in (#36)
* windowmanager destructor free _mainwindow, fix save - remove const in
settingsPath that is being written to from ptree tree

* syntax error

* remove destructor, singleton, let OS claim the resource as no special cleanup of _mainWindow is not needed
2017-04-14 14:08:57 +02:00

37 lines
706 B
C++

#ifndef ACCOUNTMANAGER_H
#define ACCOUNTMANAGER_H
#include "twitch/twitchuser.h"
#include <mutex>
#include <vector>
namespace chatterino {
class AccountManager
{
public:
static AccountManager &getInstance()
{
return instance;
}
twitch::TwitchUser &getTwitchAnon();
std::vector<twitch::TwitchUser> getTwitchUsers();
bool removeTwitchUser(const QString &userName);
void addTwitchUser(const twitch::TwitchUser &user);
private:
static AccountManager instance;
AccountManager();
twitch::TwitchUser _twitchAnon;
std::vector<twitch::TwitchUser> _twitchUsers;
std::mutex _twitchUsersMutex;
};
} // namespace chatterino
#endif // ACCOUNTMANAGER_H