mirror-chatterino2/src/singletons/completionmanager.cpp

31 lines
702 B
C++
Raw Normal View History

2017-12-31 00:50:07 +01:00
#include "singletons/completionmanager.hpp"
#include "common.hpp"
#include "debug/log.hpp"
#include "singletons/channelmanager.hpp"
#include "singletons/emotemanager.hpp"
namespace chatterino {
2017-12-31 22:58:35 +01:00
namespace singletons {
2017-12-31 00:50:07 +01:00
CompletionManager &CompletionManager::getInstance()
{
static CompletionManager instance;
return instance;
}
2018-02-05 15:11:50 +01:00
CompletionModel *CompletionManager::createModel(const QString &channelName)
2017-12-31 00:50:07 +01:00
{
auto it = this->models.find(channelName);
if (it != this->models.end()) {
return it->second;
}
2018-02-05 15:11:50 +01:00
CompletionModel *ret = new CompletionModel(channelName);
2017-12-31 00:50:07 +01:00
this->models[channelName] = ret;
return ret;
}
2018-02-05 15:11:50 +01:00
} // namespace singletons
2017-12-31 00:50:07 +01:00
} // namespace chatterino