From 08e552f5f6f4c645480f4a266ebfcb38a7c1f08a Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 26 Jun 2018 17:20:03 +0200 Subject: [PATCH] ran clang-format on all files --- src/common/Channel.hpp | 2 +- src/common/NetworkManager.hpp | 18 +++---- src/common/NetworkRequest.hpp | 48 +++++++++---------- src/common/ProviderId.hpp | 1 - .../accounts/AccountController.hpp | 5 +- src/controllers/accounts/AccountModel.hpp | 2 +- .../commands/CommandController.hpp | 3 +- src/controllers/commands/CommandModel.hpp | 2 +- src/controllers/highlights/HighlightModel.hpp | 2 +- .../highlights/HighlightPhrase.hpp | 8 ++-- src/controllers/ignores/IgnoreController.hpp | 5 +- src/controllers/ignores/IgnoreModel.hpp | 2 +- src/controllers/ignores/IgnorePhrase.hpp | 2 +- .../taggedusers/TaggedUsersController.hpp | 2 +- .../taggedusers/TaggedUsersModel.hpp | 2 +- src/messages/Message.hpp | 5 +- src/messages/MessageElement.cpp | 4 +- src/messages/layouts/MessageLayout.cpp | 2 +- src/messages/layouts/MessageLayout.hpp | 6 +-- src/providers/bttv/BttvEmotes.cpp | 22 ++++----- src/providers/bttv/BttvEmotes.hpp | 5 +- src/providers/emoji/Emojis.cpp | 12 ++--- src/providers/emoji/Emojis.hpp | 2 +- src/providers/ffz/FfzEmotes.cpp | 2 +- src/providers/ffz/FfzEmotes.hpp | 5 +- src/providers/irc/IrcServer.hpp | 2 +- src/providers/twitch/IrcMessageHandler.cpp | 5 +- src/providers/twitch/Pubsub.cpp | 11 ++--- src/providers/twitch/Pubsub.hpp | 7 ++- src/providers/twitch/TwitchAccount.cpp | 6 +-- src/providers/twitch/TwitchAccountManager.cpp | 7 ++- src/providers/twitch/TwitchChannel.cpp | 10 ++-- src/providers/twitch/TwitchChannel.hpp | 2 +- src/providers/twitch/TwitchEmotes.hpp | 2 +- src/providers/twitch/TwitchServer.cpp | 3 +- src/singletons/FontManager.cpp | 2 +- src/singletons/IrcManager.cpp | 2 +- src/singletons/UpdateManager.cpp | 6 +-- src/singletons/WindowManager.cpp | 5 +- src/singletons/WindowManager.hpp | 2 +- src/widgets/AccountSwitchWidget.cpp | 2 +- src/widgets/Notebook.cpp | 4 +- src/widgets/dialogs/QualityPopup.cpp | 3 +- src/widgets/dialogs/UserInfoPopup.cpp | 16 +++---- src/widgets/helper/ChannelView.cpp | 18 +++---- src/widgets/helper/ChannelView.hpp | 4 +- src/widgets/helper/NotebookButton.cpp | 2 +- src/widgets/helper/ResizingTextEdit.cpp | 2 +- src/widgets/helper/ResizingTextEdit.hpp | 2 +- src/widgets/helper/RippleEffectLabel.hpp | 2 +- src/widgets/helper/SettingsDialogTab.hpp | 3 +- src/widgets/helper/SignalLabel.cpp | 2 +- src/widgets/helper/SignalLabel.hpp | 2 +- src/widgets/settingspages/AccountsPage.cpp | 4 +- src/widgets/settingspages/CommandPage.cpp | 3 +- .../settingspages/HighlightingPage.cpp | 3 +- src/widgets/settingspages/IgnoreusersPage.cpp | 6 +-- src/widgets/splits/Split.cpp | 36 +++++++------- src/widgets/splits/Split.hpp | 8 ++-- src/widgets/splits/SplitContainer.cpp | 4 +- src/widgets/splits/SplitHeader.cpp | 4 +- src/widgets/splits/SplitInput.cpp | 2 +- src/widgets/splits/SplitInput.hpp | 2 +- 63 files changed, 175 insertions(+), 200 deletions(-) diff --git a/src/common/Channel.hpp b/src/common/Channel.hpp index f07a2b188..7acb8e69b 100644 --- a/src/common/Channel.hpp +++ b/src/common/Channel.hpp @@ -1,9 +1,9 @@ #pragma once +#include "common/CompletionModel.hpp" #include "messages/Image.hpp" #include "messages/LimitedQueue.hpp" #include "messages/Message.hpp" -#include "common/CompletionModel.hpp" #include "util/ConcurrentMap.hpp" #include diff --git a/src/common/NetworkManager.hpp b/src/common/NetworkManager.hpp index a081209a1..f9971427f 100644 --- a/src/common/NetworkManager.hpp +++ b/src/common/NetworkManager.hpp @@ -1,8 +1,8 @@ #pragma once -#include "debug/Log.hpp" #include "common/NetworkRequester.hpp" #include "common/NetworkWorker.hpp" +#include "debug/Log.hpp" #include #include @@ -50,11 +50,11 @@ public: worker->moveToThread(&NetworkManager::workerThread); QObject::connect( &requester, &NetworkRequester::requestUrl, worker, - [worker, onFinished = std::move(onFinished), request = std::move(request)]() { + [ worker, onFinished = std::move(onFinished), request = std::move(request) ]() { QNetworkReply *reply = NetworkManager::NaM.get(request); reply->connect(reply, &QNetworkReply::finished, - [worker, reply, onFinished = std::move(onFinished)]() { + [ worker, reply, onFinished = std::move(onFinished) ]() { onFinished(reply); delete worker; }); @@ -110,11 +110,11 @@ public: worker->moveToThread(&NetworkManager::workerThread); QObject::connect( &requester, &NetworkRequester::requestUrl, worker, - [worker, data, onFinished = std::move(onFinished), request = std::move(request)]() { + [ worker, data, onFinished = std::move(onFinished), request = std::move(request) ]() { QNetworkReply *reply = NetworkManager::NaM.put(request, *data); reply->connect(reply, &QNetworkReply::finished, - [worker, reply, onFinished = std::move(onFinished)]() { + [ worker, reply, onFinished = std::move(onFinished) ]() { onFinished(reply); delete worker; }); @@ -132,11 +132,11 @@ public: worker->moveToThread(&NetworkManager::workerThread); QObject::connect( &requester, &NetworkRequester::requestUrl, worker, - [onFinished = std::move(onFinished), request = std::move(request), worker]() { + [ onFinished = std::move(onFinished), request = std::move(request), worker ]() { QNetworkReply *reply = NetworkManager::NaM.put(request, ""); reply->connect(reply, &QNetworkReply::finished, - [onFinished = std::move(onFinished), reply, worker]() { + [ onFinished = std::move(onFinished), reply, worker ]() { onFinished(reply); delete worker; }); @@ -154,11 +154,11 @@ public: worker->moveToThread(&NetworkManager::workerThread); QObject::connect( &requester, &NetworkRequester::requestUrl, worker, - [onFinished = std::move(onFinished), request = std::move(request), worker]() { + [ onFinished = std::move(onFinished), request = std::move(request), worker ]() { QNetworkReply *reply = NetworkManager::NaM.deleteResource(request); reply->connect(reply, &QNetworkReply::finished, - [onFinished = std::move(onFinished), reply, worker]() { + [ onFinished = std::move(onFinished), reply, worker ]() { onFinished(reply); delete worker; }); diff --git a/src/common/NetworkRequest.hpp b/src/common/NetworkRequest.hpp index bb8766ab2..2c5716ecf 100644 --- a/src/common/NetworkRequest.hpp +++ b/src/common/NetworkRequest.hpp @@ -1,10 +1,10 @@ #pragma once #include "Application.hpp" -#include "singletons/PathManager.hpp" #include "common/NetworkManager.hpp" #include "common/NetworkRequester.hpp" #include "common/NetworkWorker.hpp" +#include "singletons/PathManager.hpp" #include #include @@ -32,7 +32,7 @@ static rapidjson::Document parseJSONFromData2(const QByteArray &data) if (result.Code() != rapidjson::kParseErrorNone) { Log("JSON parse error: {} ({})", rapidjson::GetParseError_En(result.Code()), - result.Offset()); + result.Offset()); return ret; } @@ -52,7 +52,7 @@ static rapidjson::Document parseJSONFromReply2(QNetworkReply *reply) if (result.Code() != rapidjson::kParseErrorNone) { Log("JSON parse error: {} ({})", rapidjson::GetParseError_En(result.Code()), - result.Offset()); + result.Offset()); return ret; } @@ -215,7 +215,7 @@ public: if (this->data.caller != nullptr) { QObject::connect(worker, &NetworkWorker::doneUrl, this->data.caller, - [onFinished, data = this->data](auto reply) mutable { + [ onFinished, data = this->data ](auto reply) mutable { if (reply->error() != QNetworkReply::NetworkError::NoError) { // TODO: We might want to call an onError callback here return; @@ -237,7 +237,7 @@ public: QObject::connect( &requester, &NetworkRequester::requestUrl, worker, - [timer, data = std::move(this->data), worker, onFinished{std::move(onFinished)}]() { + [ timer, data = std::move(this->data), worker, onFinished{std::move(onFinished)} ]() { QNetworkReply *reply = NetworkManager::NaM.get(data.request); if (timer != nullptr) { @@ -252,21 +252,21 @@ public: data.onReplyCreated(reply); } - QObject::connect(reply, &QNetworkReply::finished, worker, - [data = std::move(data), worker, reply, - onFinished = std::move(onFinished)]() mutable { - if (data.caller == nullptr) { - QByteArray bytes = reply->readAll(); - data.writeToCache(bytes); - onFinished(bytes); + QObject::connect(reply, &QNetworkReply::finished, worker, [ + data = std::move(data), worker, reply, onFinished = std::move(onFinished) + ]() mutable { + if (data.caller == nullptr) { + QByteArray bytes = reply->readAll(); + data.writeToCache(bytes); + onFinished(bytes); - reply->deleteLater(); - } else { - emit worker->doneUrl(reply); - } + reply->deleteLater(); + } else { + emit worker->doneUrl(reply); + } - delete worker; - }); + delete worker; + }); }); emit requester.requestUrl(); @@ -275,7 +275,7 @@ public: template void getJSON(FinishedCallback onFinished) { - this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes) -> bool { + this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes)->bool { auto object = parseJSONFromData(bytes); onFinished(object); @@ -288,7 +288,7 @@ public: template void getJSON2(FinishedCallback onFinished) { - this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes) -> bool { + this->get([onFinished{std::move(onFinished)}](const QByteArray &bytes)->bool { auto object = parseJSONFromData2(bytes); onFinished(object); @@ -366,8 +366,8 @@ private: worker->moveToThread(&NetworkManager::workerThread); if (this->data.caller != nullptr) { - QObject::connect(worker, &NetworkWorker::doneUrl, this->data.caller, - [data = this->data](auto reply) mutable { + QObject::connect(worker, &NetworkWorker::doneUrl, + this->data.caller, [data = this->data](auto reply) mutable { if (reply->error() != QNetworkReply::NetworkError::NoError) { if (data.onError) { data.onError(reply->error()); @@ -390,7 +390,7 @@ private: } QObject::connect(&requester, &NetworkRequester::requestUrl, worker, - [timer, data = std::move(this->data), worker]() { + [ timer, data = std::move(this->data), worker ]() { QNetworkReply *reply = nullptr; switch (data.requestType) { case GetRequest: { @@ -426,7 +426,7 @@ private: } QObject::connect(reply, &QNetworkReply::finished, worker, - [data = std::move(data), worker, reply]() mutable { + [ data = std::move(data), worker, reply ]() mutable { if (data.caller == nullptr) { QByteArray bytes = reply->readAll(); data.writeToCache(bytes); diff --git a/src/common/ProviderId.hpp b/src/common/ProviderId.hpp index 29e68bbbc..c5e2075d2 100644 --- a/src/common/ProviderId.hpp +++ b/src/common/ProviderId.hpp @@ -3,5 +3,4 @@ namespace chatterino { enum class ProviderId { Twitch }; - } diff --git a/src/controllers/accounts/AccountController.hpp b/src/controllers/accounts/AccountController.hpp index 937bda3d7..cce426e27 100644 --- a/src/controllers/accounts/AccountController.hpp +++ b/src/controllers/accounts/AccountController.hpp @@ -2,10 +2,10 @@ #include +#include "common/SignalVector2.hpp" #include "controllers/accounts/Account.hpp" #include "providers/twitch/TwitchAccountManager.hpp" #include "util/SharedPtrElementLess.hpp" -#include "common/SignalVector2.hpp" namespace chatterino { @@ -23,8 +23,7 @@ public: TwitchAccountManager twitch; private: - SortedSignalVector, SharedPtrElementLess> - accounts; + SortedSignalVector, SharedPtrElementLess> accounts; }; } // namespace chatterino diff --git a/src/controllers/accounts/AccountModel.hpp b/src/controllers/accounts/AccountModel.hpp index 38f7b2f4a..ea9c11170 100644 --- a/src/controllers/accounts/AccountModel.hpp +++ b/src/controllers/accounts/AccountModel.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/SignalVectorModel.hpp" #include "controllers/accounts/Account.hpp" #include "util/QstringHash.hpp" -#include "common/SignalVectorModel.hpp" #include diff --git a/src/controllers/commands/CommandController.hpp b/src/controllers/commands/CommandController.hpp index c4055f426..60e5cba5a 100644 --- a/src/controllers/commands/CommandController.hpp +++ b/src/controllers/commands/CommandController.hpp @@ -4,13 +4,12 @@ #include #include -#include "controllers/commands/Command.hpp" #include "common/SignalVector2.hpp" +#include "controllers/commands/Command.hpp" namespace chatterino { class Channel; - class CommandModel; class CommandController diff --git a/src/controllers/commands/CommandModel.hpp b/src/controllers/commands/CommandModel.hpp index a1fbeb7a5..434b8dfd9 100644 --- a/src/controllers/commands/CommandModel.hpp +++ b/src/controllers/commands/CommandModel.hpp @@ -2,8 +2,8 @@ #include -#include "controllers/commands/Command.hpp" #include "common/SignalVectorModel.hpp" +#include "controllers/commands/Command.hpp" namespace chatterino { diff --git a/src/controllers/highlights/HighlightModel.hpp b/src/controllers/highlights/HighlightModel.hpp index 1d49203a9..7f50287ed 100644 --- a/src/controllers/highlights/HighlightModel.hpp +++ b/src/controllers/highlights/HighlightModel.hpp @@ -2,8 +2,8 @@ #include -#include "controllers/highlights/HighlightPhrase.hpp" #include "common/SignalVectorModel.hpp" +#include "controllers/highlights/HighlightPhrase.hpp" namespace chatterino { diff --git a/src/controllers/highlights/HighlightPhrase.hpp b/src/controllers/highlights/HighlightPhrase.hpp index d568eb6bd..8441aad17 100644 --- a/src/controllers/highlights/HighlightPhrase.hpp +++ b/src/controllers/highlights/HighlightPhrase.hpp @@ -1,7 +1,7 @@ #pragma once -#include "util/RapidjsonHelpers.hpp" #include "common/SerializeCustom.hpp" +#include "util/RapidjsonHelpers.hpp" #include #include @@ -94,8 +94,7 @@ struct Deserialize { static chatterino::HighlightPhrase get(const rapidjson::Value &value) { if (!value.IsObject()) { - return chatterino::HighlightPhrase(QString(), true, false, - false); + return chatterino::HighlightPhrase(QString(), true, false, false); } QString _pattern; @@ -108,8 +107,7 @@ struct Deserialize { chatterino::rj::getSafe(value, "sound", _sound); chatterino::rj::getSafe(value, "regex", _isRegex); - return chatterino::HighlightPhrase(_pattern, _alert, _sound, - _isRegex); + return chatterino::HighlightPhrase(_pattern, _alert, _sound, _isRegex); } }; diff --git a/src/controllers/ignores/IgnoreController.hpp b/src/controllers/ignores/IgnoreController.hpp index c9d47591f..e07729c0e 100644 --- a/src/controllers/ignores/IgnoreController.hpp +++ b/src/controllers/ignores/IgnoreController.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/SignalVector2.hpp" #include "controllers/ignores/IgnorePhrase.hpp" #include "singletons/SettingsManager.hpp" -#include "common/SignalVector2.hpp" namespace chatterino { @@ -20,8 +20,7 @@ public: private: bool initialized = false; - chatterino::ChatterinoSetting> ignoresSetting = { - "/ignore/phrases"}; + chatterino::ChatterinoSetting> ignoresSetting = {"/ignore/phrases"}; }; } // namespace chatterino diff --git a/src/controllers/ignores/IgnoreModel.hpp b/src/controllers/ignores/IgnoreModel.hpp index 74037da4e..1b9a5099e 100644 --- a/src/controllers/ignores/IgnoreModel.hpp +++ b/src/controllers/ignores/IgnoreModel.hpp @@ -2,8 +2,8 @@ #include -#include "controllers/ignores/IgnorePhrase.hpp" #include "common/SignalVectorModel.hpp" +#include "controllers/ignores/IgnorePhrase.hpp" namespace chatterino { diff --git a/src/controllers/ignores/IgnorePhrase.hpp b/src/controllers/ignores/IgnorePhrase.hpp index 024358120..9e4986718 100644 --- a/src/controllers/ignores/IgnorePhrase.hpp +++ b/src/controllers/ignores/IgnorePhrase.hpp @@ -1,7 +1,7 @@ #pragma once -#include "util/RapidjsonHelpers.hpp" #include "common/SerializeCustom.hpp" +#include "util/RapidjsonHelpers.hpp" #include #include diff --git a/src/controllers/taggedusers/TaggedUsersController.hpp b/src/controllers/taggedusers/TaggedUsersController.hpp index fd309870c..b9e9c21ca 100644 --- a/src/controllers/taggedusers/TaggedUsersController.hpp +++ b/src/controllers/taggedusers/TaggedUsersController.hpp @@ -1,7 +1,7 @@ #pragma once -#include "controllers/taggedusers/TaggedUser.hpp" #include "common/SignalVector2.hpp" +#include "controllers/taggedusers/TaggedUser.hpp" namespace chatterino { diff --git a/src/controllers/taggedusers/TaggedUsersModel.hpp b/src/controllers/taggedusers/TaggedUsersModel.hpp index 7465e0fa9..44b566e5b 100644 --- a/src/controllers/taggedusers/TaggedUsersModel.hpp +++ b/src/controllers/taggedusers/TaggedUsersModel.hpp @@ -1,7 +1,7 @@ #pragma once -#include "controllers/taggedusers/TaggedUser.hpp" #include "common/SignalVectorModel.hpp" +#include "controllers/taggedusers/TaggedUser.hpp" namespace chatterino { diff --git a/src/messages/Message.hpp b/src/messages/Message.hpp index 12ad597a4..022f3bad3 100644 --- a/src/messages/Message.hpp +++ b/src/messages/Message.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/FlagsEnum.hpp" #include "messages/MessageElement.hpp" #include "providers/twitch/PubsubActions.hpp" -#include "common/FlagsEnum.hpp" #include "widgets/helper/ScrollbarHighlight.hpp" #include @@ -74,8 +74,7 @@ public: static std::shared_ptr createTimeoutMessage(const BanAction &action, uint32_t count = 1); - static std::shared_ptr createUntimeoutMessage( - const UnbanAction &action); + static std::shared_ptr createUntimeoutMessage(const UnbanAction &action); }; using MessagePtr = std::shared_ptr; diff --git a/src/messages/MessageElement.cpp b/src/messages/MessageElement.cpp index 8c887ae9a..de6f113a1 100644 --- a/src/messages/MessageElement.cpp +++ b/src/messages/MessageElement.cpp @@ -1,11 +1,11 @@ #include "messages/MessageElement.hpp" #include "Application.hpp" +#include "common/Emotemap.hpp" +#include "debug/Benchmark.hpp" #include "messages/layouts/MessageLayoutContainer.hpp" #include "messages/layouts/MessageLayoutElement.hpp" #include "singletons/SettingsManager.hpp" -#include "debug/Benchmark.hpp" -#include "common/Emotemap.hpp" namespace chatterino { diff --git a/src/messages/layouts/MessageLayout.cpp b/src/messages/layouts/MessageLayout.cpp index be245a1c3..057a4628c 100644 --- a/src/messages/layouts/MessageLayout.cpp +++ b/src/messages/layouts/MessageLayout.cpp @@ -1,10 +1,10 @@ #include "messages/layouts/MessageLayout.hpp" #include "Application.hpp" +#include "debug/Benchmark.hpp" #include "singletons/EmoteManager.hpp" #include "singletons/SettingsManager.hpp" #include "singletons/WindowManager.hpp" -#include "debug/Benchmark.hpp" #include #include diff --git a/src/messages/layouts/MessageLayout.hpp b/src/messages/layouts/MessageLayout.hpp index 3084931cb..f7354a3ae 100644 --- a/src/messages/layouts/MessageLayout.hpp +++ b/src/messages/layouts/MessageLayout.hpp @@ -1,10 +1,10 @@ #pragma once -#include "messages/layouts/MessageLayoutContainer.hpp" -#include "messages/layouts/MessageLayoutElement.hpp" +#include "common/FlagsEnum.hpp" #include "messages/Message.hpp" #include "messages/Selection.hpp" -#include "common/FlagsEnum.hpp" +#include "messages/layouts/MessageLayoutContainer.hpp" +#include "messages/layouts/MessageLayoutElement.hpp" #include diff --git a/src/providers/bttv/BttvEmotes.cpp b/src/providers/bttv/BttvEmotes.cpp index 87da6ce8d..5a2783c63 100644 --- a/src/providers/bttv/BttvEmotes.cpp +++ b/src/providers/bttv/BttvEmotes.cpp @@ -1,8 +1,8 @@ #include "providers/bttv/BttvEmotes.hpp" +#include "common/UrlFetch.hpp" #include "debug/Log.hpp" #include "messages/Image.hpp" -#include "common/UrlFetch.hpp" namespace chatterino { @@ -37,11 +37,11 @@ void BTTVEmotes::loadGlobalEmotes() EmoteData emoteData; emoteData.image1x = new chatterino::Image(getEmoteLink(urlTemplate, id, "1x"), 1, code, - code + "
Global BTTV Emote"); - emoteData.image2x = new chatterino::Image(getEmoteLink(urlTemplate, id, "2x"), 0.5, code, - code + "
Global BTTV Emote"); - emoteData.image3x = new chatterino::Image(getEmoteLink(urlTemplate, id, "3x"), 0.25, code, - code + "
Global BTTV Emote"); + code + "
Global BTTV Emote"); + emoteData.image2x = new chatterino::Image(getEmoteLink(urlTemplate, id, "2x"), 0.5, + code, code + "
Global BTTV Emote"); + emoteData.image3x = new chatterino::Image(getEmoteLink(urlTemplate, id, "3x"), 0.25, + code, code + "
Global BTTV Emote"); emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id; this->globalEmotes.insert(code, emoteData); @@ -91,17 +91,17 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptrChannel BTTV Emote"); + code, code + "
Channel BTTV Emote"); link = linkTemplate; link.detach(); emoteData.image2x = - new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "2x"), 0.5, - code, code + "
Channel BTTV Emote"); + new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "2x"), + 0.5, code, code + "
Channel BTTV Emote"); link = linkTemplate; link.detach(); emoteData.image3x = - new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "3x"), 0.25, - code, code + "
Channel BTTV Emote"); + new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "3x"), + 0.25, code, code + "
Channel BTTV Emote"); emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id; return emoteData; diff --git a/src/providers/bttv/BttvEmotes.hpp b/src/providers/bttv/BttvEmotes.hpp index 69e2df819..2df25aa5d 100644 --- a/src/providers/bttv/BttvEmotes.hpp +++ b/src/providers/bttv/BttvEmotes.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/Emotemap.hpp" #include "common/SignalVector.hpp" #include "util/ConcurrentMap.hpp" -#include "common/Emotemap.hpp" #include @@ -18,8 +18,7 @@ public: std::map> channelEmoteCodes; void loadGlobalEmotes(); - void loadChannelEmotes(const QString &channelName, - std::weak_ptr channelEmoteMap); + void loadChannelEmotes(const QString &channelName, std::weak_ptr channelEmoteMap); private: EmoteMap channelEmoteCache; diff --git a/src/providers/emoji/Emojis.cpp b/src/providers/emoji/Emojis.cpp index 2a3d9e1c9..9b274ced6 100644 --- a/src/providers/emoji/Emojis.cpp +++ b/src/providers/emoji/Emojis.cpp @@ -112,7 +112,7 @@ void Emojis::loadEmojis() if (result.Code() != rapidjson::kParseErrorNone) { Log("JSON parse error: {} ({})", rapidjson::GetParseError_En(result.Code()), - result.Offset()); + result.Offset()); return; } @@ -266,8 +266,7 @@ void Emojis::loadEmojiSet() }); } -void Emojis::parse(std::vector> &parsedWords, - const QString &text) +void Emojis::parse(std::vector> &parsedWords, const QString &text) { int lastParsedEmojiEndIndex = 0; @@ -328,13 +327,12 @@ void Emojis::parse(std::vector> &parsedWords, if (charactersFromLastParsedEmoji > 0) { // Add characters inbetween emojis - parsedWords.emplace_back(EmoteData(), text.mid(lastParsedEmojiEndIndex, - charactersFromLastParsedEmoji)); + parsedWords.emplace_back( + EmoteData(), text.mid(lastParsedEmojiEndIndex, charactersFromLastParsedEmoji)); } // Push the emoji as a word to parsedWords - parsedWords.push_back( - std::tuple(matchedEmoji->emoteData, QString())); + parsedWords.push_back(std::tuple(matchedEmoji->emoteData, QString())); lastParsedEmojiEndIndex = currentParsedEmojiEndIndex; diff --git a/src/providers/emoji/Emojis.hpp b/src/providers/emoji/Emojis.hpp index 4d80c7428..814a11251 100644 --- a/src/providers/emoji/Emojis.hpp +++ b/src/providers/emoji/Emojis.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/Emotemap.hpp" #include "common/SignalVector.hpp" #include "util/ConcurrentMap.hpp" -#include "common/Emotemap.hpp" #include #include diff --git a/src/providers/ffz/FfzEmotes.cpp b/src/providers/ffz/FfzEmotes.cpp index 136ededf6..4f7398ce8 100644 --- a/src/providers/ffz/FfzEmotes.cpp +++ b/src/providers/ffz/FfzEmotes.cpp @@ -1,8 +1,8 @@ #include "providers/ffz/FfzEmotes.hpp" +#include "common/UrlFetch.hpp" #include "debug/Log.hpp" #include "messages/Image.hpp" -#include "common/UrlFetch.hpp" namespace chatterino { diff --git a/src/providers/ffz/FfzEmotes.hpp b/src/providers/ffz/FfzEmotes.hpp index 44c4b5b7d..90caeb207 100644 --- a/src/providers/ffz/FfzEmotes.hpp +++ b/src/providers/ffz/FfzEmotes.hpp @@ -1,8 +1,8 @@ #pragma once +#include "common/Emotemap.hpp" #include "common/SignalVector.hpp" #include "util/ConcurrentMap.hpp" -#include "common/Emotemap.hpp" #include @@ -18,8 +18,7 @@ public: std::map> channelEmoteCodes; void loadGlobalEmotes(); - void loadChannelEmotes(const QString &channelName, - std::weak_ptr channelEmoteMap); + void loadChannelEmotes(const QString &channelName, std::weak_ptr channelEmoteMap); private: ConcurrentMap channelEmoteCache; diff --git a/src/providers/irc/IrcServer.hpp b/src/providers/irc/IrcServer.hpp index 645dc2f30..874179b47 100644 --- a/src/providers/irc/IrcServer.hpp +++ b/src/providers/irc/IrcServer.hpp @@ -1,7 +1,7 @@ #pragma once -#include "providers/irc/IrcAccount.hpp" #include "providers/irc/AbstractIrcServer.hpp" +#include "providers/irc/IrcAccount.hpp" namespace chatterino { diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index eb15a65e3..546dbde5e 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -140,8 +140,7 @@ void IrcMessageHandler::handleClearChatMessage(Communi::IrcMessage *message) auto chan = app->twitch.server->getChannelOrEmpty(chanName); if (chan->isEmpty()) { - Log("[IrcMessageHandler:handleClearChatMessage] Twitch channel {} not found", - chanName); + Log("[IrcMessageHandler:handleClearChatMessage] Twitch channel {} not found", chanName); return; } @@ -312,7 +311,7 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message) if (channel->isEmpty()) { Log("[IrcManager:handleNoticeMessage] Channel {} not found in channel manager ", - channelName); + channelName); return; } diff --git a/src/providers/twitch/Pubsub.cpp b/src/providers/twitch/Pubsub.cpp index d9f749e0c..5398e059d 100644 --- a/src/providers/twitch/Pubsub.cpp +++ b/src/providers/twitch/Pubsub.cpp @@ -507,8 +507,8 @@ void PubSub::unlistenAllModerationActions() } } -void PubSub::listenToChannelModerationActions( - const QString &channelID, std::shared_ptr account) +void PubSub::listenToChannelModerationActions(const QString &channelID, + std::shared_ptr account) { assert(!channelID.isEmpty()); assert(account != nullptr); @@ -527,8 +527,7 @@ void PubSub::listenToChannelModerationActions( this->listenToTopic(topic, account); } -void PubSub::listenToTopic(const std::string &topic, - std::shared_ptr account) +void PubSub::listenToTopic(const std::string &topic, std::shared_ptr account) { auto message = createListenMessage({topic}, account); @@ -581,7 +580,7 @@ void PubSub::onMessage(websocketpp::connection_hdl hdl, WebsocketMessagePtr webs if (!res) { Log("Error parsing message '{}' from PubSub: {}", payload, - rapidjson::GetParseError_En(res.Code())); + rapidjson::GetParseError_En(res.Code())); return; } @@ -713,7 +712,7 @@ void PubSub::handleMessageResponse(const rapidjson::Value &outerData) if (!res) { Log("Error parsing message '{}' from PubSub: {}", payload, - rapidjson::GetParseError_En(res.Code())); + rapidjson::GetParseError_En(res.Code())); return; } diff --git a/src/providers/twitch/Pubsub.hpp b/src/providers/twitch/Pubsub.hpp index 04443de68..5737737c9 100644 --- a/src/providers/twitch/Pubsub.hpp +++ b/src/providers/twitch/Pubsub.hpp @@ -121,14 +121,13 @@ public: void unlistenAllModerationActions(); - void listenToChannelModerationActions( - const QString &channelID, std::shared_ptr account); + void listenToChannelModerationActions(const QString &channelID, + std::shared_ptr account); std::vector> requests; private: - void listenToTopic(const std::string &topic, - std::shared_ptr account); + void listenToTopic(const std::string &topic, std::shared_ptr account); void listen(rapidjson::Document &&msg); bool tryListen(rapidjson::Document &msg); diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index 754ed22f7..1654cad09 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -1,10 +1,10 @@ #include "providers/twitch/TwitchAccount.hpp" -#include "providers/twitch/Const.hpp" -#include "debug/Log.hpp" #include "common/NetworkRequest.hpp" -#include "util/RapidjsonHelpers.hpp" #include "common/UrlFetch.hpp" +#include "debug/Log.hpp" +#include "providers/twitch/Const.hpp" +#include "util/RapidjsonHelpers.hpp" namespace chatterino { diff --git a/src/providers/twitch/TwitchAccountManager.cpp b/src/providers/twitch/TwitchAccountManager.cpp index 4bfa2b8b4..11ccba948 100644 --- a/src/providers/twitch/TwitchAccountManager.cpp +++ b/src/providers/twitch/TwitchAccountManager.cpp @@ -1,8 +1,8 @@ #include "providers/twitch/TwitchAccountManager.hpp" #include "common/Common.hpp" -#include "providers/twitch/Const.hpp" #include "debug/Log.hpp" +#include "providers/twitch/Const.hpp" namespace chatterino { @@ -123,11 +123,10 @@ void TwitchAccountManager::load() auto user = this->findUserByUsername(newUsername); if (user) { Log("[AccountManager:currentUsernameChanged] User successfully updated to {}", - newUsername); + newUsername); this->currentUser = user; } else { - Log( - "[AccountManager:currentUsernameChanged] User successfully updated to anonymous"); + Log("[AccountManager:currentUsernameChanged] User successfully updated to anonymous"); this->currentUser = this->anonymousUser; } diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 2a5abe4ae..77a245849 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -1,6 +1,7 @@ #include "providers/twitch/TwitchChannel.hpp" #include "common/Common.hpp" +#include "common/UrlFetch.hpp" #include "debug/Log.hpp" #include "messages/Message.hpp" #include "providers/twitch/Pubsub.hpp" @@ -9,7 +10,6 @@ #include "singletons/IrcManager.hpp" #include "singletons/SettingsManager.hpp" #include "util/PostToThread.hpp" -#include "common/UrlFetch.hpp" #include #include @@ -84,7 +84,7 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection } twitchApiGet("https://tmi.twitch.tv/group/user/" + this->name + "/chatters", - QThread::currentThread(), refreshChatters); + QThread::currentThread(), refreshChatters); }; doRefreshChatters(); @@ -145,7 +145,7 @@ void TwitchChannel::sendMessage(const QString &message) // manager" dialog this->addMessage( chatterino::Message::createSystemMessage("You need to log in to send messages. You can " - "link your Twitch account in the settings.")); + "link your Twitch account in the settings.")); return; } @@ -234,7 +234,7 @@ void TwitchChannel::addJoinedUser(const QString &user) std::lock_guard guard(this->joinedUserMutex); auto message = chatterino::Message::createSystemMessage("Users joined: " + - this->joinedUsers.join(", ")); + this->joinedUsers.join(", ")); message->flags |= chatterino::Message::Collapsed; this->addMessage(message); this->joinedUsers.clear(); @@ -263,7 +263,7 @@ void TwitchChannel::addPartedUser(const QString &user) std::lock_guard guard(this->partedUserMutex); auto message = chatterino::Message::createSystemMessage("Users parted: " + - this->partedUsers.join(", ")); + this->partedUsers.join(", ")); message->flags |= chatterino::Message::Collapsed; this->addMessage(message); this->partedUsers.clear(); diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index 9a77243d8..415927c19 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -4,10 +4,10 @@ #include "common/Channel.hpp" #include "common/Common.hpp" +#include "common/MutexValue.hpp" #include "singletons/EmoteManager.hpp" #include "singletons/IrcManager.hpp" #include "util/ConcurrentMap.hpp" -#include "common/MutexValue.hpp" #include diff --git a/src/providers/twitch/TwitchEmotes.hpp b/src/providers/twitch/TwitchEmotes.hpp index 17729ad24..ef772625a 100644 --- a/src/providers/twitch/TwitchEmotes.hpp +++ b/src/providers/twitch/TwitchEmotes.hpp @@ -1,10 +1,10 @@ #pragma once +#include "common/Emotemap.hpp" #include "providers/twitch/EmoteValue.hpp" #include "providers/twitch/TwitchAccount.hpp" #include "providers/twitch/TwitchEmotes.hpp" #include "util/ConcurrentMap.hpp" -#include "common/Emotemap.hpp" #include diff --git a/src/providers/twitch/TwitchServer.cpp b/src/providers/twitch/TwitchServer.cpp index d95962761..60133a14f 100644 --- a/src/providers/twitch/TwitchServer.cpp +++ b/src/providers/twitch/TwitchServer.cpp @@ -32,8 +32,7 @@ void TwitchServer::initialize() [this]() { postToThread([this] { this->connect(); }); }); } -void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead, - bool isWrite) +void TwitchServer::initializeConnection(IrcConnection *connection, bool isRead, bool isWrite) { std::shared_ptr account = getApp()->accounts->twitch.getCurrent(); diff --git a/src/singletons/FontManager.cpp b/src/singletons/FontManager.cpp index fcd95c888..a9309b1b6 100644 --- a/src/singletons/FontManager.cpp +++ b/src/singletons/FontManager.cpp @@ -4,8 +4,8 @@ #include #include "Application.hpp" -#include "debug/AssertInGuiThread.hpp" #include "WindowManager.hpp" +#include "debug/AssertInGuiThread.hpp" #ifdef Q_OS_WIN32 #define DEFAULT_FONT_FAMILY "Segoe UI" diff --git a/src/singletons/IrcManager.cpp b/src/singletons/IrcManager.cpp index 9df7d6d90..c9997a45c 100644 --- a/src/singletons/IrcManager.cpp +++ b/src/singletons/IrcManager.cpp @@ -22,7 +22,7 @@ //#include -//using namespace chatterino::messages; +// using namespace chatterino::messages; // void IrcManager::refreshIgnoredUsers(const QString &username, const QString &oauthClient, // const QString &oauthToken) diff --git a/src/singletons/UpdateManager.cpp b/src/singletons/UpdateManager.cpp index d8ead5a50..1a582e2b6 100644 --- a/src/singletons/UpdateManager.cpp +++ b/src/singletons/UpdateManager.cpp @@ -75,9 +75,9 @@ void UpdateManager::installUpdates() return false; } - QProcess::startDetached(combinePath(QCoreApplication::applicationDirPath(), - "updater.1/ChatterinoUpdater.exe"), - {filename, "restart"}); + QProcess::startDetached( + combinePath(QCoreApplication::applicationDirPath(), "updater.1/ChatterinoUpdater.exe"), + {filename, "restart"}); QApplication::exit(0); return false; diff --git a/src/singletons/WindowManager.cpp b/src/singletons/WindowManager.cpp index 102a58e10..7b2ba5a09 100644 --- a/src/singletons/WindowManager.cpp +++ b/src/singletons/WindowManager.cpp @@ -1,12 +1,12 @@ #include "WindowManager.hpp" #include "Application.hpp" +#include "debug/AssertInGuiThread.hpp" #include "debug/Log.hpp" #include "providers/twitch/TwitchServer.hpp" #include "singletons/FontManager.hpp" #include "singletons/PathManager.hpp" #include "singletons/ThemeManager.hpp" -#include "debug/AssertInGuiThread.hpp" #include "util/Clamp.hpp" #include "widgets/AccountSwitchPopupWidget.hpp" #include "widgets/dialogs/SettingsDialog.hpp" @@ -169,8 +169,7 @@ void WindowManager::initialize() // get type QString type_val = window_obj.value("type").toString(); - Window::WindowType type = - type_val == "main" ? Window::Main : Window::Popup; + Window::WindowType type = type_val == "main" ? Window::Main : Window::Popup; if (type == Window::Main && mainWindow != nullptr) { type = Window::Popup; diff --git a/src/singletons/WindowManager.hpp b/src/singletons/WindowManager.hpp index 3b19dc682..79e15034b 100644 --- a/src/singletons/WindowManager.hpp +++ b/src/singletons/WindowManager.hpp @@ -1,7 +1,7 @@ #pragma once -#include "widgets/splits/SplitContainer.hpp" #include "widgets/Window.hpp" +#include "widgets/splits/SplitContainer.hpp" namespace chatterino { diff --git a/src/widgets/AccountSwitchWidget.cpp b/src/widgets/AccountSwitchWidget.cpp index 9eccaef67..115b234b3 100644 --- a/src/widgets/AccountSwitchWidget.cpp +++ b/src/widgets/AccountSwitchWidget.cpp @@ -1,8 +1,8 @@ #include "AccountSwitchWidget.hpp" #include "Application.hpp" -#include "providers/twitch/Const.hpp" #include "controllers/accounts/AccountController.hpp" +#include "providers/twitch/Const.hpp" namespace chatterino { diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index 14ebed1a9..8272e84bf 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -4,12 +4,12 @@ #include "debug/Log.hpp" #include "singletons/ThemeManager.hpp" #include "singletons/WindowManager.hpp" +#include "widgets/Window.hpp" +#include "widgets/dialogs/SettingsDialog.hpp" #include "widgets/helper/NotebookButton.hpp" #include "widgets/helper/NotebookTab.hpp" #include "widgets/helper/Shortcut.hpp" -#include "widgets/dialogs/SettingsDialog.hpp" #include "widgets/splits/SplitContainer.hpp" -#include "widgets/Window.hpp" #include #include diff --git a/src/widgets/dialogs/QualityPopup.cpp b/src/widgets/dialogs/QualityPopup.cpp index c19413eef..3bc14f98b 100644 --- a/src/widgets/dialogs/QualityPopup.cpp +++ b/src/widgets/dialogs/QualityPopup.cpp @@ -16,7 +16,8 @@ QualityPopup::QualityPopup(const QString &_channelName, QStringList options) &QualityPopup::cancelButtonClicked); this->ui_.buttonBox.addButton(&this->ui_.okButton, QDialogButtonBox::ButtonRole::AcceptRole); - this->ui_.buttonBox.addButton(&this->ui_.cancelButton, QDialogButtonBox::ButtonRole::RejectRole); + this->ui_.buttonBox.addButton(&this->ui_.cancelButton, + QDialogButtonBox::ButtonRole::RejectRole); this->ui_.selector.addItems(options); diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 101136898..03620fae2 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -1,14 +1,14 @@ #include "UserInfoPopup.hpp" #include "Application.hpp" +#include "common/UrlFetch.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "singletons/ResourceManager.hpp" #include "util/LayoutCreator.hpp" #include "util/PostToThread.hpp" -#include "common/UrlFetch.hpp" +#include "widgets/Label.hpp" #include "widgets/helper/Line.hpp" #include "widgets/helper/RippleEffectLabel.hpp" -#include "widgets/Label.hpp" #include #include @@ -86,8 +86,7 @@ UserInfoPopup::UserInfoPopup() // userstate this->userStateChanged.connect([this, mod, unmod]() mutable { - TwitchChannel *twitchChannel = - dynamic_cast(this->channel_.get()); + TwitchChannel *twitchChannel = dynamic_cast(this->channel_.get()); if (twitchChannel) { qDebug() << this->userName_; @@ -111,8 +110,7 @@ UserInfoPopup::UserInfoPopup() auto timeout = moderation.emplace(); this->userStateChanged.connect([this, lineMod, timeout]() mutable { - TwitchChannel *twitchChannel = - dynamic_cast(this->channel_.get()); + TwitchChannel *twitchChannel = dynamic_cast(this->channel_.get()); if (twitchChannel) { lineMod->setVisible(twitchChannel->hasModRights()); @@ -171,8 +169,7 @@ void UserInfoPopup::installEvents() this->ui_.follow->setEnabled(false); if (this->ui_.follow->isChecked()) { - twitchApiPut(requestUrl, - [this](QJsonObject) { this->ui_.follow->setEnabled(true); }); + twitchApiPut(requestUrl, [this](QJsonObject) { this->ui_.follow->setEnabled(true); }); } else { twitchApiDelete(requestUrl, [this] { this->ui_.follow->setEnabled(true); }); } @@ -306,8 +303,7 @@ void UserInfoPopup::loadAvatar(const QUrl &url) UserInfoPopup::TimeoutWidget::TimeoutWidget() : BaseWidget(nullptr) { - auto layout = - LayoutCreator(this).setLayoutType().withoutMargin(); + auto layout = LayoutCreator(this).setLayoutType().withoutMargin(); QColor color1(255, 255, 255, 80); QColor color2(255, 255, 255, 0); diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index e3e222f4f..4dedc9030 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1,19 +1,19 @@ #include "ChannelView.hpp" #include "Application.hpp" +#include "debug/Benchmark.hpp" #include "debug/Log.hpp" -#include "messages/layouts/MessageLayout.hpp" #include "messages/LimitedQueueSnapshot.hpp" #include "messages/Message.hpp" +#include "messages/layouts/MessageLayout.hpp" #include "providers/twitch/TwitchServer.hpp" #include "singletons/SettingsManager.hpp" #include "singletons/ThemeManager.hpp" #include "singletons/WindowManager.hpp" -#include "debug/Benchmark.hpp" #include "util/DistanceBetweenPoints.hpp" -#include "widgets/splits/Split.hpp" #include "widgets/TooltipWidget.hpp" #include "widgets/dialogs/UserInfoPopup.hpp" +#include "widgets/splits/Split.hpp" #include #include @@ -271,7 +271,8 @@ QString ChannelView::getSelectedText() { QString result = ""; - chatterino::LimitedQueueSnapshot messagesSnapshot = this->getMessagesSnapshot(); + chatterino::LimitedQueueSnapshot messagesSnapshot = + this->getMessagesSnapshot(); Selection _selection = this->selection_; @@ -436,7 +437,7 @@ void ChannelView::setChannel(ChannelPtr newChannel) auto snapshot = this->messages.getSnapshot(); if (index >= snapshot.getLength()) { Log("Tried to replace out of bounds message. Index: {}. Length: {}", index, - snapshot.getLength()); + snapshot.getLength()); return; } @@ -882,8 +883,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event) if (this->isMouseDown_) { this->isMouseDown_ = false; - if (fabsf(distanceBetweenPoints(this->lastPressPosition_, event->screenPos())) > - 15.f) { + if (fabsf(distanceBetweenPoints(this->lastPressPosition_, event->screenPos())) > 15.f) { return; } } else { @@ -893,8 +893,8 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event) if (this->isRightMouseDown_) { this->isRightMouseDown_ = false; - if (fabsf(distanceBetweenPoints(this->lastRightPressPosition_, - event->screenPos())) > 15.f) { + if (fabsf(distanceBetweenPoints(this->lastRightPressPosition_, event->screenPos())) > + 15.f) { return; } } else { diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index cf75d9e72..b3ae61894 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -2,13 +2,13 @@ #include "common/Channel.hpp" #include "messages/Image.hpp" -#include "messages/layouts/MessageLayout.hpp" #include "messages/LimitedQueueSnapshot.hpp" #include "messages/MessageElement.hpp" #include "messages/Selection.hpp" +#include "messages/layouts/MessageLayout.hpp" #include "widgets/BaseWidget.hpp" -#include "widgets/helper/RippleEffectLabel.hpp" #include "widgets/Scrollbar.hpp" +#include "widgets/helper/RippleEffectLabel.hpp" #include #include diff --git a/src/widgets/helper/NotebookButton.cpp b/src/widgets/helper/NotebookButton.cpp index 37ee00052..5e624c1c9 100644 --- a/src/widgets/helper/NotebookButton.cpp +++ b/src/widgets/helper/NotebookButton.cpp @@ -1,7 +1,7 @@ #include "widgets/helper/NotebookButton.hpp" #include "singletons/ThemeManager.hpp" -#include "widgets/helper/RippleEffectButton.hpp" #include "widgets/Notebook.hpp" +#include "widgets/helper/RippleEffectButton.hpp" #include "widgets/splits/SplitContainer.hpp" #include diff --git a/src/widgets/helper/ResizingTextEdit.cpp b/src/widgets/helper/ResizingTextEdit.cpp index 251e10e46..7c10d0e15 100644 --- a/src/widgets/helper/ResizingTextEdit.cpp +++ b/src/widgets/helper/ResizingTextEdit.cpp @@ -203,4 +203,4 @@ QCompleter *ResizingTextEdit::getCompleter() const return this->completer; } -} +} // namespace chatterino diff --git a/src/widgets/helper/ResizingTextEdit.hpp b/src/widgets/helper/ResizingTextEdit.hpp index c2adc9597..0e633cdc4 100644 --- a/src/widgets/helper/ResizingTextEdit.hpp +++ b/src/widgets/helper/ResizingTextEdit.hpp @@ -41,4 +41,4 @@ private slots: void insertCompletion(const QString &completion); }; -} +} // namespace chatterino diff --git a/src/widgets/helper/RippleEffectLabel.hpp b/src/widgets/helper/RippleEffectLabel.hpp index 0ddbebc48..a18119905 100644 --- a/src/widgets/helper/RippleEffectLabel.hpp +++ b/src/widgets/helper/RippleEffectLabel.hpp @@ -1,9 +1,9 @@ #pragma once #include "widgets/BaseWidget.hpp" +#include "widgets/Label.hpp" #include "widgets/helper/RippleEffectButton.hpp" #include "widgets/helper/SignalLabel.hpp" -#include "widgets/Label.hpp" #include #include diff --git a/src/widgets/helper/SettingsDialogTab.hpp b/src/widgets/helper/SettingsDialogTab.hpp index 5078813c3..8b608bcd6 100644 --- a/src/widgets/helper/SettingsDialogTab.hpp +++ b/src/widgets/helper/SettingsDialogTab.hpp @@ -16,8 +16,7 @@ class SettingsDialogTab : public BaseWidget Q_OBJECT public: - SettingsDialogTab(SettingsDialog *dialog, SettingsPage *page, - QString imageFileName); + SettingsDialogTab(SettingsDialog *dialog, SettingsPage *page, QString imageFileName); void setSelected(bool selected); SettingsPage *getSettingsPage(); diff --git a/src/widgets/helper/SignalLabel.cpp b/src/widgets/helper/SignalLabel.cpp index 4e6944c79..cbf8bf5b9 100644 --- a/src/widgets/helper/SignalLabel.cpp +++ b/src/widgets/helper/SignalLabel.cpp @@ -36,4 +36,4 @@ void SignalLabel::mouseMoveEvent(QMouseEvent *event) event->ignore(); } -} +} // namespace chatterino diff --git a/src/widgets/helper/SignalLabel.hpp b/src/widgets/helper/SignalLabel.hpp index f9c936739..382840265 100644 --- a/src/widgets/helper/SignalLabel.hpp +++ b/src/widgets/helper/SignalLabel.hpp @@ -29,4 +29,4 @@ protected: void mouseMoveEvent(QMouseEvent *event) override; }; -} +} // namespace chatterino diff --git a/src/widgets/settingspages/AccountsPage.cpp b/src/widgets/settingspages/AccountsPage.cpp index 7cecafdd2..ca9ff0258 100644 --- a/src/widgets/settingspages/AccountsPage.cpp +++ b/src/widgets/settingspages/AccountsPage.cpp @@ -1,12 +1,12 @@ #include "AccountsPage.hpp" #include "Application.hpp" -#include "providers/twitch/Const.hpp" #include "controllers/accounts/AccountController.hpp" #include "controllers/accounts/AccountModel.hpp" +#include "providers/twitch/Const.hpp" #include "util/LayoutCreator.hpp" -#include "widgets/helper/EditableModelView.hpp" #include "widgets/dialogs/LoginDialog.hpp" +#include "widgets/helper/EditableModelView.hpp" #include #include diff --git a/src/widgets/settingspages/CommandPage.cpp b/src/widgets/settingspages/CommandPage.cpp index 800bba137..905ed8c81 100644 --- a/src/widgets/settingspages/CommandPage.cpp +++ b/src/widgets/settingspages/CommandPage.cpp @@ -40,8 +40,7 @@ CommandPage::CommandPage() view->setTitles({"Trigger", "Command"}); view->getTableView()->horizontalHeader()->setStretchLastSection(true); view->addButtonPressed.connect([] { - getApp()->commands->items.appendItem( - Command{"/command", "I made a new command HeyGuys"}); + getApp()->commands->items.appendItem(Command{"/command", "I made a new command HeyGuys"}); }); layout.append(this->createCheckBox("Also match the trigger at the end of the message", diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index 4246cd6f0..c437e93d9 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -44,8 +44,7 @@ HighlightingPage::HighlightingPage() auto highlights = tabs.appendTab(new QVBoxLayout, "Highlights"); { EditableModelView *view = - highlights - .emplace(app->highlights->createModel(nullptr)) + highlights.emplace(app->highlights->createModel(nullptr)) .getElement(); view->setTitles({"Pattern", "Flash taskbar", "Play sound", "Regex"}); diff --git a/src/widgets/settingspages/IgnoreusersPage.cpp b/src/widgets/settingspages/IgnoreusersPage.cpp index 708016857..9195bc856 100644 --- a/src/widgets/settingspages/IgnoreusersPage.cpp +++ b/src/widgets/settingspages/IgnoreusersPage.cpp @@ -64,8 +64,7 @@ IgnoreUsersPage::IgnoreUsersPage() auto messages = tabs.appendTab(new QVBoxLayout, "Messages"); { EditableModelView *view = - messages.emplace(app->ignores->createModel(nullptr)) - .getElement(); + messages.emplace(app->ignores->createModel(nullptr)).getElement(); view->setTitles({"Pattern", "Regex"}); view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); view->getTableView()->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); @@ -77,8 +76,7 @@ IgnoreUsersPage::IgnoreUsersPage() }); view->addButtonPressed.connect([] { - getApp()->ignores->phrases.appendItem( - IgnorePhrase{"my phrase", false}); + getApp()->ignores->phrases.appendItem(IgnorePhrase{"my phrase", false}); }); } diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 2c6f5c917..87db97eb5 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -2,6 +2,7 @@ #include "Application.hpp" #include "common/Common.hpp" +#include "common/UrlFetch.hpp" #include "providers/twitch/EmoteValue.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" @@ -10,17 +11,16 @@ #include "singletons/ThemeManager.hpp" #include "singletons/WindowManager.hpp" #include "util/StreamLink.hpp" -#include "common/UrlFetch.hpp" +#include "widgets/Window.hpp" +#include "widgets/dialogs/QualityPopup.hpp" +#include "widgets/dialogs/SelectChannelDialog.hpp" +#include "widgets/dialogs/TextInputDialog.hpp" +#include "widgets/dialogs/UserInfoPopup.hpp" #include "widgets/helper/DebugPopup.hpp" #include "widgets/helper/SearchPopup.hpp" #include "widgets/helper/Shortcut.hpp" -#include "widgets/splits/SplitOverlay.hpp" -#include "widgets/dialogs/QualityPopup.hpp" -#include "widgets/dialogs/SelectChannelDialog.hpp" #include "widgets/splits/SplitContainer.hpp" -#include "widgets/dialogs/TextInputDialog.hpp" -#include "widgets/dialogs/UserInfoPopup.hpp" -#include "widgets/Window.hpp" +#include "widgets/splits/SplitOverlay.hpp" #include #include @@ -449,18 +449,18 @@ void Split::doOpenViewerList() } auto loadingLabel = new QLabel("Loading..."); - twitchApiGet("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters", - this, [=](QJsonObject obj) { - QJsonObject chattersObj = obj.value("chatters").toObject(); + twitchApiGet("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters", this, + [=](QJsonObject obj) { + QJsonObject chattersObj = obj.value("chatters").toObject(); - loadingLabel->hide(); - for (int i = 0; i < jsonLabels.size(); i++) { - chattersList->addItem(labelList.at(i)); - foreach (const QJsonValue &v, - chattersObj.value(jsonLabels.at(i)).toArray()) - chattersList->addItem(v.toString()); - } - }); + loadingLabel->hide(); + for (int i = 0; i < jsonLabels.size(); i++) { + chattersList->addItem(labelList.at(i)); + foreach (const QJsonValue &v, + chattersObj.value(jsonLabels.at(i)).toArray()) + chattersList->addItem(v.toString()); + } + }); searchBar->setPlaceholderText("Search User..."); QObject::connect(searchBar, &QLineEdit::textEdited, this, [=]() { diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 92065f888..3f5142bd3 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -1,12 +1,12 @@ #pragma once #include "common/Channel.hpp" -#include "messages/layouts/MessageLayout.hpp" -#include "messages/layouts/MessageLayoutElement.hpp" -#include "messages/LimitedQueueSnapshot.hpp" -#include "messages/MessageElement.hpp" #include "common/NullablePtr.hpp" #include "common/SerializeCustom.hpp" +#include "messages/LimitedQueueSnapshot.hpp" +#include "messages/MessageElement.hpp" +#include "messages/layouts/MessageLayout.hpp" +#include "messages/layouts/MessageLayoutElement.hpp" #include "widgets/BaseWidget.hpp" #include "widgets/helper/ChannelView.hpp" #include "widgets/helper/RippleEffectLabel.hpp" diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index b1797b6a1..0929d40d2 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -1,13 +1,13 @@ #include "widgets/splits/SplitContainer.hpp" #include "Application.hpp" #include "common/Common.hpp" +#include "debug/AssertInGuiThread.hpp" #include "singletons/ThemeManager.hpp" #include "singletons/WindowManager.hpp" -#include "debug/AssertInGuiThread.hpp" #include "util/Helpers.hpp" #include "util/LayoutCreator.hpp" -#include "widgets/helper/NotebookTab.hpp" #include "widgets/Notebook.hpp" +#include "widgets/helper/NotebookTab.hpp" #include "widgets/splits/Split.hpp" #include diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 199a0459d..881e7abdb 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -1,16 +1,16 @@ #include "widgets/splits/SplitHeader.hpp" #include "Application.hpp" +#include "common/UrlFetch.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchServer.hpp" #include "singletons/ResourceManager.hpp" #include "singletons/ThemeManager.hpp" #include "util/LayoutCreator.hpp" -#include "common/UrlFetch.hpp" #include "widgets/Label.hpp" +#include "widgets/TooltipWidget.hpp" #include "widgets/splits/Split.hpp" #include "widgets/splits/SplitContainer.hpp" -#include "widgets/TooltipWidget.hpp" #include #include diff --git a/src/widgets/splits/SplitInput.cpp b/src/widgets/splits/SplitInput.cpp index bedacea51..28f432914 100644 --- a/src/widgets/splits/SplitInput.cpp +++ b/src/widgets/splits/SplitInput.cpp @@ -1,6 +1,7 @@ #include "widgets/splits/SplitInput.hpp" #include "Application.hpp" +#include "common/UrlFetch.hpp" #include "controllers/commands/CommandController.hpp" #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchServer.hpp" @@ -8,7 +9,6 @@ #include "singletons/SettingsManager.hpp" #include "singletons/ThemeManager.hpp" #include "util/LayoutCreator.hpp" -#include "common/UrlFetch.hpp" #include "widgets/Notebook.hpp" #include "widgets/splits/Split.hpp" #include "widgets/splits/SplitContainer.hpp" diff --git a/src/widgets/splits/SplitInput.hpp b/src/widgets/splits/SplitInput.hpp index a2e87ebfb..777b126e0 100644 --- a/src/widgets/splits/SplitInput.hpp +++ b/src/widgets/splits/SplitInput.hpp @@ -1,8 +1,8 @@ #pragma once -#include "widgets/helper/ResizingTextEdit.hpp" #include "widgets/BaseWidget.hpp" #include "widgets/dialogs/EmotePopup.hpp" +#include "widgets/helper/ResizingTextEdit.hpp" #include "widgets/helper/RippleEffectLabel.hpp" #include