ran clang-format on all files

This commit is contained in:
fourtf 2018-06-26 17:20:03 +02:00
parent 6ee1fc303e
commit 08e552f5f6
63 changed files with 175 additions and 200 deletions

View file

@ -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 <QString>

View file

@ -1,8 +1,8 @@
#pragma once
#include "debug/Log.hpp"
#include "common/NetworkRequester.hpp"
#include "common/NetworkWorker.hpp"
#include "debug/Log.hpp"
#include <QJsonDocument>
#include <QJsonObject>
@ -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;
});

View file

@ -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 <rapidjson/document.h>
#include <rapidjson/error/en.h>
@ -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,9 +252,9 @@ public:
data.onReplyCreated(reply);
}
QObject::connect(reply, &QNetworkReply::finished, worker,
[data = std::move(data), worker, reply,
onFinished = std::move(onFinished)]() mutable {
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);
@ -275,7 +275,7 @@ public:
template <typename FinishedCallback>
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 <typename FinishedCallback>
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);

View file

@ -3,5 +3,4 @@
namespace chatterino {
enum class ProviderId { Twitch };
}

View file

@ -2,10 +2,10 @@
#include <QObject>
#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<std::shared_ptr<Account>, SharedPtrElementLess<Account>>
accounts;
SortedSignalVector<std::shared_ptr<Account>, SharedPtrElementLess<Account>> accounts;
};
} // namespace chatterino

View file

@ -1,8 +1,8 @@
#pragma once
#include "common/SignalVectorModel.hpp"
#include "controllers/accounts/Account.hpp"
#include "util/QstringHash.hpp"
#include "common/SignalVectorModel.hpp"
#include <unordered_map>

View file

@ -4,13 +4,12 @@
#include <memory>
#include <mutex>
#include "controllers/commands/Command.hpp"
#include "common/SignalVector2.hpp"
#include "controllers/commands/Command.hpp"
namespace chatterino {
class Channel;
class CommandModel;
class CommandController

View file

@ -2,8 +2,8 @@
#include <QObject>
#include "controllers/commands/Command.hpp"
#include "common/SignalVectorModel.hpp"
#include "controllers/commands/Command.hpp"
namespace chatterino {

View file

@ -2,8 +2,8 @@
#include <QObject>
#include "controllers/highlights/HighlightPhrase.hpp"
#include "common/SignalVectorModel.hpp"
#include "controllers/highlights/HighlightPhrase.hpp"
namespace chatterino {

View file

@ -1,7 +1,7 @@
#pragma once
#include "util/RapidjsonHelpers.hpp"
#include "common/SerializeCustom.hpp"
#include "util/RapidjsonHelpers.hpp"
#include <QRegularExpression>
#include <QString>
@ -94,8 +94,7 @@ struct Deserialize<chatterino::HighlightPhrase> {
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::HighlightPhrase> {
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);
}
};

View file

@ -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<std::vector<IgnorePhrase>> ignoresSetting = {
"/ignore/phrases"};
chatterino::ChatterinoSetting<std::vector<IgnorePhrase>> ignoresSetting = {"/ignore/phrases"};
};
} // namespace chatterino

View file

@ -2,8 +2,8 @@
#include <QObject>
#include "controllers/ignores/IgnorePhrase.hpp"
#include "common/SignalVectorModel.hpp"
#include "controllers/ignores/IgnorePhrase.hpp"
namespace chatterino {

View file

@ -1,7 +1,7 @@
#pragma once
#include "util/RapidjsonHelpers.hpp"
#include "common/SerializeCustom.hpp"
#include "util/RapidjsonHelpers.hpp"
#include <QRegularExpression>
#include <QString>

View file

@ -1,7 +1,7 @@
#pragma once
#include "controllers/taggedusers/TaggedUser.hpp"
#include "common/SignalVector2.hpp"
#include "controllers/taggedusers/TaggedUser.hpp"
namespace chatterino {

View file

@ -1,7 +1,7 @@
#pragma once
#include "controllers/taggedusers/TaggedUser.hpp"
#include "common/SignalVectorModel.hpp"
#include "controllers/taggedusers/TaggedUser.hpp"
namespace chatterino {

View file

@ -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 <QTime>
@ -74,8 +74,7 @@ public:
static std::shared_ptr<Message> createTimeoutMessage(const BanAction &action,
uint32_t count = 1);
static std::shared_ptr<Message> createUntimeoutMessage(
const UnbanAction &action);
static std::shared_ptr<Message> createUntimeoutMessage(const UnbanAction &action);
};
using MessagePtr = std::shared_ptr<Message>;

View file

@ -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 {

View file

@ -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 <QApplication>
#include <QDebug>

View file

@ -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 <QPixmap>

View file

@ -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 {
@ -38,10 +38,10 @@ void BTTVEmotes::loadGlobalEmotes()
EmoteData emoteData;
emoteData.image1x = new chatterino::Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
code + "<br />Global BTTV Emote");
emoteData.image2x = new chatterino::Image(getEmoteLink(urlTemplate, id, "2x"), 0.5, code,
code + "<br />Global BTTV Emote");
emoteData.image3x = new chatterino::Image(getEmoteLink(urlTemplate, id, "3x"), 0.25, code,
code + "<br />Global BTTV Emote");
emoteData.image2x = new chatterino::Image(getEmoteLink(urlTemplate, id, "2x"), 0.5,
code, code + "<br />Global BTTV Emote");
emoteData.image3x = new chatterino::Image(getEmoteLink(urlTemplate, id, "3x"), 0.25,
code, code + "<br />Global BTTV Emote");
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
this->globalEmotes.insert(code, emoteData);
@ -95,13 +95,13 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<Emo
link = linkTemplate;
link.detach();
emoteData.image2x =
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "2x"), 0.5,
code, code + "<br />Channel BTTV Emote");
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
0.5, code, code + "<br />Channel BTTV Emote");
link = linkTemplate;
link.detach();
emoteData.image3x =
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "3x"), 0.25,
code, code + "<br />Channel BTTV Emote");
new chatterino::Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
0.25, code, code + "<br />Channel BTTV Emote");
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
return emoteData;

View file

@ -1,8 +1,8 @@
#pragma once
#include "common/Emotemap.hpp"
#include "common/SignalVector.hpp"
#include "util/ConcurrentMap.hpp"
#include "common/Emotemap.hpp"
#include <map>
@ -18,8 +18,7 @@ public:
std::map<QString, SignalVector<QString>> channelEmoteCodes;
void loadGlobalEmotes();
void loadChannelEmotes(const QString &channelName,
std::weak_ptr<EmoteMap> channelEmoteMap);
void loadChannelEmotes(const QString &channelName, std::weak_ptr<EmoteMap> channelEmoteMap);
private:
EmoteMap channelEmoteCache;

View file

@ -266,8 +266,7 @@ void Emojis::loadEmojiSet()
});
}
void Emojis::parse(std::vector<std::tuple<EmoteData, QString>> &parsedWords,
const QString &text)
void Emojis::parse(std::vector<std::tuple<EmoteData, QString>> &parsedWords, const QString &text)
{
int lastParsedEmojiEndIndex = 0;
@ -328,13 +327,12 @@ void Emojis::parse(std::vector<std::tuple<EmoteData, QString>> &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<EmoteData, QString>(matchedEmoji->emoteData, QString()));
parsedWords.push_back(std::tuple<EmoteData, QString>(matchedEmoji->emoteData, QString()));
lastParsedEmojiEndIndex = currentParsedEmojiEndIndex;

View file

@ -1,8 +1,8 @@
#pragma once
#include "common/Emotemap.hpp"
#include "common/SignalVector.hpp"
#include "util/ConcurrentMap.hpp"
#include "common/Emotemap.hpp"
#include <QMap>
#include <QRegularExpression>

View file

@ -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 {

View file

@ -1,8 +1,8 @@
#pragma once
#include "common/Emotemap.hpp"
#include "common/SignalVector.hpp"
#include "util/ConcurrentMap.hpp"
#include "common/Emotemap.hpp"
#include <map>
@ -18,8 +18,7 @@ public:
std::map<QString, SignalVector<QString>> channelEmoteCodes;
void loadGlobalEmotes();
void loadChannelEmotes(const QString &channelName,
std::weak_ptr<EmoteMap> channelEmoteMap);
void loadChannelEmotes(const QString &channelName, std::weak_ptr<EmoteMap> channelEmoteMap);
private:
ConcurrentMap<int, EmoteData> channelEmoteCache;

View file

@ -1,7 +1,7 @@
#pragma once
#include "providers/irc/IrcAccount.hpp"
#include "providers/irc/AbstractIrcServer.hpp"
#include "providers/irc/IrcAccount.hpp"
namespace chatterino {

View file

@ -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;
}

View file

@ -507,8 +507,8 @@ void PubSub::unlistenAllModerationActions()
}
}
void PubSub::listenToChannelModerationActions(
const QString &channelID, std::shared_ptr<TwitchAccount> account)
void PubSub::listenToChannelModerationActions(const QString &channelID,
std::shared_ptr<TwitchAccount> 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<TwitchAccount> account)
void PubSub::listenToTopic(const std::string &topic, std::shared_ptr<TwitchAccount> account)
{
auto message = createListenMessage({topic}, account);

View file

@ -121,14 +121,13 @@ public:
void unlistenAllModerationActions();
void listenToChannelModerationActions(
const QString &channelID, std::shared_ptr<TwitchAccount> account);
void listenToChannelModerationActions(const QString &channelID,
std::shared_ptr<TwitchAccount> account);
std::vector<std::unique_ptr<rapidjson::Document>> requests;
private:
void listenToTopic(const std::string &topic,
std::shared_ptr<TwitchAccount> account);
void listenToTopic(const std::string &topic, std::shared_ptr<TwitchAccount> account);
void listen(rapidjson::Document &&msg);
bool tryListen(rapidjson::Document &msg);

View file

@ -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 {

View file

@ -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 {
@ -126,8 +126,7 @@ void TwitchAccountManager::load()
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;
}

View file

@ -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 <IrcConnection>
#include <QThread>

View file

@ -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 <pajlada/signals/signalholder.hpp>

View file

@ -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 <map>

View file

@ -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<TwitchAccount> account = getApp()->accounts->twitch.getCurrent();

View file

@ -4,8 +4,8 @@
#include <QtGlobal>
#include "Application.hpp"
#include "debug/AssertInGuiThread.hpp"
#include "WindowManager.hpp"
#include "debug/AssertInGuiThread.hpp"
#ifdef Q_OS_WIN32
#define DEFAULT_FONT_FAMILY "Segoe UI"

View file

@ -22,7 +22,7 @@
//#include <future>
//using namespace chatterino::messages;
// using namespace chatterino::messages;
// void IrcManager::refreshIgnoredUsers(const QString &username, const QString &oauthClient,
// const QString &oauthToken)

View file

@ -75,8 +75,8 @@ void UpdateManager::installUpdates()
return false;
}
QProcess::startDetached(combinePath(QCoreApplication::applicationDirPath(),
"updater.1/ChatterinoUpdater.exe"),
QProcess::startDetached(
combinePath(QCoreApplication::applicationDirPath(), "updater.1/ChatterinoUpdater.exe"),
{filename, "restart"});
QApplication::exit(0);

View file

@ -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;

View file

@ -1,7 +1,7 @@
#pragma once
#include "widgets/splits/SplitContainer.hpp"
#include "widgets/Window.hpp"
#include "widgets/splits/SplitContainer.hpp"
namespace chatterino {

View file

@ -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 {

View file

@ -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 <QDebug>
#include <QFile>

View file

@ -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);

View file

@ -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 <QCheckBox>
#include <QDesktopServices>
@ -86,8 +86,7 @@ UserInfoPopup::UserInfoPopup()
// userstate
this->userStateChanged.connect([this, mod, unmod]() mutable {
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->channel_.get());
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(this->channel_.get());
if (twitchChannel) {
qDebug() << this->userName_;
@ -111,8 +110,7 @@ UserInfoPopup::UserInfoPopup()
auto timeout = moderation.emplace<TimeoutWidget>();
this->userStateChanged.connect([this, lineMod, timeout]() mutable {
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->channel_.get());
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(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<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
auto layout = LayoutCreator<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
QColor color1(255, 255, 255, 80);
QColor color2(255, 255, 255, 0);

View file

@ -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 <QClipboard>
#include <QDebug>
@ -271,7 +271,8 @@ QString ChannelView::getSelectedText()
{
QString result = "";
chatterino::LimitedQueueSnapshot<MessageLayoutPtr> messagesSnapshot = this->getMessagesSnapshot();
chatterino::LimitedQueueSnapshot<MessageLayoutPtr> messagesSnapshot =
this->getMessagesSnapshot();
Selection _selection = this->selection_;
@ -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 {

View file

@ -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 <QPaintEvent>
#include <QScroller>

View file

@ -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 <QMouseEvent>

View file

@ -203,4 +203,4 @@ QCompleter *ResizingTextEdit::getCompleter() const
return this->completer;
}
}
} // namespace chatterino

View file

@ -41,4 +41,4 @@ private slots:
void insertCompletion(const QString &completion);
};
}
} // namespace chatterino

View file

@ -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 <QHBoxLayout>
#include <QLabel>

View file

@ -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();

View file

@ -36,4 +36,4 @@ void SignalLabel::mouseMoveEvent(QMouseEvent *event)
event->ignore();
}
}
} // namespace chatterino

View file

@ -29,4 +29,4 @@ protected:
void mouseMoveEvent(QMouseEvent *event) override;
};
}
} // namespace chatterino

View file

@ -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 <QDialogButtonBox>
#include <QHeaderView>

View file

@ -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",

View file

@ -44,8 +44,7 @@ HighlightingPage::HighlightingPage()
auto highlights = tabs.appendTab(new QVBoxLayout, "Highlights");
{
EditableModelView *view =
highlights
.emplace<EditableModelView>(app->highlights->createModel(nullptr))
highlights.emplace<EditableModelView>(app->highlights->createModel(nullptr))
.getElement();
view->setTitles({"Pattern", "Flash taskbar", "Play sound", "Regex"});

View file

@ -64,8 +64,7 @@ IgnoreUsersPage::IgnoreUsersPage()
auto messages = tabs.appendTab(new QVBoxLayout, "Messages");
{
EditableModelView *view =
messages.emplace<EditableModelView>(app->ignores->createModel(nullptr))
.getElement();
messages.emplace<EditableModelView>(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});
});
}

View file

@ -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 <QApplication>
#include <QClipboard>
@ -449,8 +449,8 @@ void Split::doOpenViewerList()
}
auto loadingLabel = new QLabel("Loading...");
twitchApiGet("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters",
this, [=](QJsonObject obj) {
twitchApiGet("https://tmi.twitch.tv/group/user/" + this->getChannel()->name + "/chatters", this,
[=](QJsonObject obj) {
QJsonObject chattersObj = obj.value("chatters").toObject();
loadingLabel->hide();

View file

@ -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"

View file

@ -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 <QApplication>

View file

@ -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 <QByteArray>
#include <QDrag>

View file

@ -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"

View file

@ -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 <QHBoxLayout>