renamed *Manager files
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#include "singletons/Logging.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "singletons/Paths.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
|
||||
#include <QDir>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void LoggingManager::initialize()
|
||||
{
|
||||
this->pathManager = getApp()->paths;
|
||||
}
|
||||
|
||||
void LoggingManager::addMessage(const QString &channelName, MessagePtr message)
|
||||
{
|
||||
auto app = getApp();
|
||||
|
||||
if (!app->settings->enableLogging) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = this->loggingChannels.find(channelName);
|
||||
if (it == this->loggingChannels.end()) {
|
||||
auto channel = new LoggingChannel(channelName);
|
||||
channel->addMessage(message);
|
||||
this->loggingChannels.emplace(channelName,
|
||||
std::unique_ptr<LoggingChannel>(std::move(channel)));
|
||||
} else {
|
||||
it->second->addMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user