renamed SharedChannel to ChannelPtr for consistency

This commit is contained in:
fourtf
2018-01-24 13:15:41 +01:00
parent fa344deaf0
commit 2b94c4cd33
17 changed files with 46 additions and 46 deletions
+5 -5
View File
@@ -19,11 +19,11 @@ ChannelManager::ChannelManager()
{
}
const std::vector<SharedChannel> ChannelManager::getItems()
const std::vector<ChannelPtr> ChannelManager::getItems()
{
QMutexLocker locker(&this->channelsMutex);
std::vector<SharedChannel> items;
std::vector<ChannelPtr> items;
for (auto &item : this->twitchChannels.values()) {
items.push_back(std::get<0>(item));
@@ -32,7 +32,7 @@ const std::vector<SharedChannel> ChannelManager::getItems()
return items;
}
SharedChannel ChannelManager::addTwitchChannel(const QString &rawChannelName)
ChannelPtr ChannelManager::addTwitchChannel(const QString &rawChannelName)
{
QString channelName = rawChannelName.toLower();
@@ -63,7 +63,7 @@ SharedChannel ChannelManager::addTwitchChannel(const QString &rawChannelName)
return std::get<0>(it.value());
}
SharedChannel ChannelManager::getTwitchChannel(const QString &channel)
ChannelPtr ChannelManager::getTwitchChannel(const QString &channel)
{
QMutexLocker locker(&this->channelsMutex);
@@ -128,7 +128,7 @@ const std::string &ChannelManager::getUserID(const std::string &username)
return temporary;
}
void ChannelManager::doOnAll(std::function<void(SharedChannel)> func)
void ChannelManager::doOnAll(std::function<void(ChannelPtr)> func)
{
for (const auto &channel : this->twitchChannels) {
func(std::get<0>(channel));
+7 -7
View File
@@ -17,20 +17,20 @@ class ChannelManager
public:
static ChannelManager &getInstance();
const std::vector<SharedChannel> getItems();
const std::vector<ChannelPtr> getItems();
SharedChannel addTwitchChannel(const QString &channel);
SharedChannel getTwitchChannel(const QString &channel);
ChannelPtr addTwitchChannel(const QString &channel);
ChannelPtr getTwitchChannel(const QString &channel);
void removeTwitchChannel(const QString &channel);
const std::string &getUserID(const std::string &username);
void doOnAll(std::function<void(SharedChannel)> func);
void doOnAll(std::function<void(ChannelPtr)> func);
// Special channels
const SharedChannel whispersChannel;
const SharedChannel mentionsChannel;
const SharedChannel emptyChannel;
const ChannelPtr whispersChannel;
const ChannelPtr mentionsChannel;
const ChannelPtr emptyChannel;
private:
std::map<std::string, std::string> usernameToID;
+1 -1
View File
@@ -88,7 +88,7 @@ QStringList CommandManager::getCommands()
return this->commandsStringList;
}
QString CommandManager::execCommand(const QString &text, SharedChannel channel,
QString CommandManager::execCommand(const QString &text, ChannelPtr channel,
bool dryRun)
{
QStringList words = text.split(' ', QString::SkipEmptyParts);
+2 -2
View File
@@ -391,7 +391,7 @@ void IrcManager::onConnected()
MessagePtr msg = Message::createSystemMessage("connected to chat");
MessagePtr remsg = Message::createSystemMessage("reconnected to chat");
this->channelManager.doOnAll([msg, remsg](SharedChannel channel) {
this->channelManager.doOnAll([msg, remsg](ChannelPtr channel) {
assert(channel);
LimitedQueueSnapshot<MessagePtr> snapshot = channel->getMessageSnapshot();
@@ -412,7 +412,7 @@ void IrcManager::onDisconnected()
MessagePtr msg = Message::createSystemMessage("disconnected from chat");
msg->addFlags(Message::DisconnectedMessage);
this->channelManager.doOnAll([msg](SharedChannel channel) {
this->channelManager.doOnAll([msg](ChannelPtr channel) {
assert(channel);
channel->addMessage(msg);
});