made channels shared_pointers
This commit is contained in:
+19
-10
@@ -8,20 +8,28 @@ namespace chatterino {
|
||||
class Channels
|
||||
{
|
||||
public:
|
||||
static Channel *
|
||||
static std::shared_ptr<Channel>
|
||||
getWhispers()
|
||||
{
|
||||
return &whispers;
|
||||
return whispers;
|
||||
}
|
||||
|
||||
static Channel *
|
||||
static std::shared_ptr<Channel>
|
||||
getMentions()
|
||||
{
|
||||
return &mentions;
|
||||
return mentions;
|
||||
}
|
||||
|
||||
static Channel *addChannel(const QString &channel);
|
||||
static Channel *getChannel(const QString &channel);
|
||||
static std::shared_ptr<Channel>
|
||||
getEmpty()
|
||||
{
|
||||
return empty;
|
||||
}
|
||||
|
||||
const static std::vector<std::shared_ptr<Channel>> getItems();
|
||||
|
||||
static std::shared_ptr<Channel> addChannel(const QString &channel);
|
||||
static std::shared_ptr<Channel> getChannel(const QString &channel);
|
||||
static void removeChannel(const QString &channel);
|
||||
|
||||
private:
|
||||
@@ -29,11 +37,12 @@ private:
|
||||
{
|
||||
}
|
||||
|
||||
static Channel whispers;
|
||||
static Channel mentions;
|
||||
static Channel empty;
|
||||
static std::shared_ptr<Channel> whispers;
|
||||
static std::shared_ptr<Channel> mentions;
|
||||
static std::shared_ptr<Channel> empty;
|
||||
|
||||
static QMap<QString, std::tuple<Channel *, int>> channels;
|
||||
static QMap<QString, std::tuple<std::shared_ptr<Channel>, int>> channels;
|
||||
static QMutex channelsMutex;
|
||||
};
|
||||
}
|
||||
#endif // CHANNELS_H
|
||||
|
||||
Reference in New Issue
Block a user