diff --git a/chatterino.pro b/chatterino.pro index e88ff6a8f..5df70d4c8 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -273,14 +273,14 @@ HEADERS += \ src/util/networkrequest.hpp \ src/util/networkworker.hpp \ src/util/networkrequester.hpp \ - src/util/flagsenum.h \ src/widgets/settingspages/ignoreuserspage.hpp \ src/widgets/settingspages/ignoremessagespage.hpp \ src/widgets/settingspages/specialchannelspage.hpp \ src/widgets/settingspages/keyboardsettings.hpp \ src/widgets/settingspages/keyboardsettingspage.hpp \ src/widgets/helper/titlebarbutton.hpp \ - src/widgets/helper/label.hpp + src/widgets/helper/label.hpp \ + src/util/flagsenum.hpp RESOURCES += \ resources/resources.qrc diff --git a/src/messages/layouts/messagelayout.hpp b/src/messages/layouts/messagelayout.hpp index bcbf3f01c..fbd871859 100644 --- a/src/messages/layouts/messagelayout.hpp +++ b/src/messages/layouts/messagelayout.hpp @@ -4,7 +4,7 @@ #include "messages/layouts/messagelayoutelement.hpp" #include "messages/message.hpp" #include "messages/selection.hpp" -#include "util/flagsenum.h" +#include "util/flagsenum.hpp" #include diff --git a/src/messages/message.hpp b/src/messages/message.hpp index d33be6634..3a6b1bcea 100644 --- a/src/messages/message.hpp +++ b/src/messages/message.hpp @@ -1,7 +1,7 @@ #pragma once #include "messages/messageelement.hpp" -#include "util/flagsenum.h" +#include "util/flagsenum.hpp" #include "widgets/helper/scrollbarhighlight.hpp" #include diff --git a/src/messages/messagebuilder.hpp b/src/messages/messagebuilder.hpp index 3b9b550d3..933eb5ba6 100644 --- a/src/messages/messagebuilder.hpp +++ b/src/messages/messagebuilder.hpp @@ -21,8 +21,7 @@ public: void appendTimestamp(const QTime &time); QString matchLink(const QString &string); - template ::value>::type> + template T *emplace(Args &&... args) { static_assert(std::is_base_of::value, "T must extend MessageElement"); diff --git a/src/singletons/loggingmanager.cpp b/src/singletons/loggingmanager.cpp index 432f8f8a4..943077a1a 100644 --- a/src/singletons/loggingmanager.cpp +++ b/src/singletons/loggingmanager.cpp @@ -34,7 +34,8 @@ void LoggingManager::addMessage(const QString &channelName, messages::MessagePtr if (it == this->loggingChannels.end()) { auto channel = new LoggingChannel(channelName, this->getDirectoryForChannel(channelName)); channel->addMessage(message); - this->loggingChannels.emplace(channelName, std::move(channel)); + this->loggingChannels.emplace(channelName, + std::unique_ptr(std::move(channel))); } else { it->second->addMessage(message); } diff --git a/src/util/flagsenum.h b/src/util/flagsenum.hpp similarity index 82% rename from src/util/flagsenum.h rename to src/util/flagsenum.hpp index a6301db00..08a7ea55b 100644 --- a/src/util/flagsenum.h +++ b/src/util/flagsenum.hpp @@ -5,8 +5,9 @@ namespace chatterino { namespace util { -template ::value>::type, - typename Q = std::underlying_type::type> +// = std::enable_if::value>::type + +template ::type> class FlagsEnum { public: