started to refactor Application

This commit is contained in:
fourtf
2018-07-07 11:41:01 +02:00
parent 6a418e6e59
commit c609a9fd37
32 changed files with 195 additions and 147 deletions
+3 -6
View File
@@ -12,16 +12,13 @@
namespace chatterino {
void Logging::initialize()
void Logging::initialize(Application &app)
{
this->pathManager = getApp()->paths;
}
void Logging::addMessage(const QString &channelName, MessagePtr message)
{
auto app = getApp();
if (!app->settings->enableLogging) {
if (!getSettings()->enableLogging) {
return;
}
@@ -30,7 +27,7 @@ void Logging::addMessage(const QString &channelName, MessagePtr message)
auto channel = new LoggingChannel(channelName);
channel->addMessage(message);
this->loggingChannels_.emplace(channelName,
std::unique_ptr<LoggingChannel>(std::move(channel)));
std::unique_ptr<LoggingChannel>(std::move(channel)));
} else {
it->second->addMessage(message);
}