mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Run clang-format-all.sh
This commit is contained in:
parent
b73f65fa20
commit
e757a6504b
12 changed files with 55 additions and 52 deletions
|
@ -171,8 +171,8 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
||||||
auto target = words.at(1);
|
auto target = words.at(1);
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
channel->addMessage(Message::createSystemMessage(
|
channel->addMessage(
|
||||||
"You must be logged in to ignore someone"));
|
Message::createSystemMessage("You must be logged in to ignore someone"));
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,8 +188,8 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
||||||
auto target = words.at(1);
|
auto target = words.at(1);
|
||||||
|
|
||||||
if (user->isAnon()) {
|
if (user->isAnon()) {
|
||||||
channel->addMessage(Message::createSystemMessage(
|
channel->addMessage(
|
||||||
"You must be logged in to ignore someone"));
|
Message::createSystemMessage("You must be logged in to ignore someone"));
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,11 @@ void BTTVEmotes::loadGlobalEmotes()
|
||||||
|
|
||||||
EmoteData emoteData;
|
EmoteData emoteData;
|
||||||
emoteData.image1x = new Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
|
emoteData.image1x = new Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
|
||||||
code + "<br />Global BTTV Emote");
|
code + "<br />Global BTTV Emote");
|
||||||
emoteData.image2x = new Image(getEmoteLink(urlTemplate, id, "2x"), 0.5,
|
emoteData.image2x = new Image(getEmoteLink(urlTemplate, id, "2x"), 0.5, code,
|
||||||
code, code + "<br />Global BTTV Emote");
|
code + "<br />Global BTTV Emote");
|
||||||
emoteData.image3x = new Image(getEmoteLink(urlTemplate, id, "3x"), 0.25,
|
emoteData.image3x = new Image(getEmoteLink(urlTemplate, id, "3x"), 0.25, code,
|
||||||
code, code + "<br />Global BTTV Emote");
|
code + "<br />Global BTTV Emote");
|
||||||
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
||||||
|
|
||||||
this->globalEmotes.insert(code, emoteData);
|
this->globalEmotes.insert(code, emoteData);
|
||||||
|
@ -89,19 +89,16 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<Emo
|
||||||
EmoteData emoteData;
|
EmoteData emoteData;
|
||||||
QString link = linkTemplate;
|
QString link = linkTemplate;
|
||||||
link.detach();
|
link.detach();
|
||||||
emoteData.image1x =
|
emoteData.image1x = new Image(link.replace("{{id}}", id).replace("{{image}}", "1x"),
|
||||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "1x"), 1,
|
1, code, code + "<br />Channel BTTV Emote");
|
||||||
code, code + "<br />Channel BTTV Emote");
|
|
||||||
link = linkTemplate;
|
link = linkTemplate;
|
||||||
link.detach();
|
link.detach();
|
||||||
emoteData.image2x =
|
emoteData.image2x = new Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
||||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
0.5, code, code + "<br />Channel BTTV Emote");
|
||||||
0.5, code, code + "<br />Channel BTTV Emote");
|
|
||||||
link = linkTemplate;
|
link = linkTemplate;
|
||||||
link.detach();
|
link.detach();
|
||||||
emoteData.image3x =
|
emoteData.image3x = new Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
||||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
0.25, code, code + "<br />Channel BTTV Emote");
|
||||||
0.25, code, code + "<br />Channel BTTV Emote");
|
|
||||||
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
||||||
|
|
||||||
return emoteData;
|
return emoteData;
|
||||||
|
|
|
@ -260,8 +260,8 @@ void Emojis::loadEmojiSet()
|
||||||
urlPrefix = it->second;
|
urlPrefix = it->second;
|
||||||
}
|
}
|
||||||
QString url = urlPrefix + code + ".png";
|
QString url = urlPrefix + code + ".png";
|
||||||
emoji->emoteData.image1x = new Image(
|
emoji->emoteData.image1x =
|
||||||
url, 0.35, emoji->value, ":" + emoji->shortCodes[0] + ":<br/>Emoji");
|
new Image(url, 0.35, emoji->value, ":" + emoji->shortCodes[0] + ":<br/>Emoji");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,8 +253,7 @@ void IrcMessageHandler::handleUserNoticeMessage(Communi::IrcMessage *message, Tw
|
||||||
auto it = tags.find("system-msg");
|
auto it = tags.find("system-msg");
|
||||||
|
|
||||||
if (it != tags.end()) {
|
if (it != tags.end()) {
|
||||||
auto newMessage =
|
auto newMessage = Message::createSystemMessage(parseTagString(it.value().toString()));
|
||||||
Message::createSystemMessage(parseTagString(it.value().toString()));
|
|
||||||
|
|
||||||
newMessage->flags |= Message::Subscription;
|
newMessage->flags |= Message::Subscription;
|
||||||
|
|
||||||
|
@ -322,12 +321,22 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||||
void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message)
|
void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||||
{
|
{
|
||||||
static std::unordered_set<std::string> readConnectionOnlyIDs{
|
static std::unordered_set<std::string> readConnectionOnlyIDs{
|
||||||
"host_on", "host_off", "host_target_went_offline", "emote_only_on", "emote_only_off",
|
"host_on",
|
||||||
"slow_on", "slow_off", "subs_on", "subs_off", "r9k_on", "r9k_off",
|
"host_off",
|
||||||
|
"host_target_went_offline",
|
||||||
|
"emote_only_on",
|
||||||
|
"emote_only_off",
|
||||||
|
"slow_on",
|
||||||
|
"slow_off",
|
||||||
|
"subs_on",
|
||||||
|
"subs_off",
|
||||||
|
"r9k_on",
|
||||||
|
"r9k_off",
|
||||||
|
|
||||||
// Display for user who times someone out. This implies you're a moderator, at which point
|
// Display for user who times someone out. This implies you're a moderator, at which point
|
||||||
// you will be connected to PubSub and receive a better message from there
|
// you will be connected to PubSub and receive a better message from there
|
||||||
"timeout_success", "ban_success",
|
"timeout_success",
|
||||||
|
"ban_success",
|
||||||
};
|
};
|
||||||
|
|
||||||
QVariant v = message->tag("msg-id");
|
QVariant v = message->tag("msg-id");
|
||||||
|
|
|
@ -194,8 +194,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
||||||
// check if you are sending messages too fast
|
// check if you are sending messages too fast
|
||||||
if (!lastMessage.empty() && lastMessage.back() + minMessageOffset > now) {
|
if (!lastMessage.empty() && lastMessage.back() + minMessageOffset > now) {
|
||||||
if (this->lastErrorTimeSpeed_ + 30s < now) {
|
if (this->lastErrorTimeSpeed_ + 30s < now) {
|
||||||
auto errorMessage =
|
auto errorMessage = Message::createSystemMessage("sending messages too fast");
|
||||||
Message::createSystemMessage("sending messages too fast");
|
|
||||||
|
|
||||||
channel->addMessage(errorMessage);
|
channel->addMessage(errorMessage);
|
||||||
|
|
||||||
|
@ -212,8 +211,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
||||||
// check if you are sending too many messages
|
// check if you are sending too many messages
|
||||||
if (lastMessage.size() >= maxMessageCount) {
|
if (lastMessage.size() >= maxMessageCount) {
|
||||||
if (this->lastErrorTimeAmount_ + 30s < now) {
|
if (this->lastErrorTimeAmount_ + 30s < now) {
|
||||||
auto errorMessage =
|
auto errorMessage = Message::createSystemMessage("sending too many messages");
|
||||||
Message::createSystemMessage("sending too many messages");
|
|
||||||
|
|
||||||
channel->addMessage(errorMessage);
|
channel->addMessage(errorMessage);
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@ void Paths::initSubDirectories()
|
||||||
|
|
||||||
// create settings subdirectories and validate that they are created properly
|
// create settings subdirectories and validate that they are created properly
|
||||||
auto makePath = [&](const std::string &name) -> QString {
|
auto makePath = [&](const std::string &name) -> QString {
|
||||||
|
|
||||||
auto path = combinePath(this->rootAppDataDirectory, QString::fromStdString(name));
|
auto path = combinePath(this->rootAppDataDirectory, QString::fromStdString(name));
|
||||||
|
|
||||||
if (!QDir().mkpath(path)) {
|
if (!QDir().mkpath(path)) {
|
||||||
|
|
|
@ -76,8 +76,7 @@ void TooltipWidget::updateFont()
|
||||||
{
|
{
|
||||||
auto app = getApp();
|
auto app = getApp();
|
||||||
|
|
||||||
this->setFont(
|
this->setFont(app->fonts->getFont(Fonts::Type::ChatMediumSmall, this->getScale()));
|
||||||
app->fonts->getFont(Fonts::Type::ChatMediumSmall, this->getScale()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TooltipWidget::setText(QString text)
|
void TooltipWidget::setText(QString text)
|
||||||
|
|
|
@ -364,9 +364,11 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
|
||||||
}
|
}
|
||||||
a->setBorderColor(color1);
|
a->setBorderColor(color1);
|
||||||
|
|
||||||
QObject::connect(a.getElement(), &RippleEffectLabel2::clicked, [
|
QObject::connect(
|
||||||
this, timeout = std::get<1>(item)
|
a.getElement(), &RippleEffectLabel2::clicked,
|
||||||
] { this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout)); });
|
[this, timeout = std::get<1>(item)] {
|
||||||
|
this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -375,16 +377,21 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
|
||||||
|
|
||||||
addTimeouts("sec", {{"1", 1}});
|
addTimeouts("sec", {{"1", 1}});
|
||||||
addTimeouts("min", {
|
addTimeouts("min", {
|
||||||
{"1", 1 * 60}, {"5", 5 * 60}, {"10", 10 * 60},
|
{"1", 1 * 60},
|
||||||
|
{"5", 5 * 60},
|
||||||
|
{"10", 10 * 60},
|
||||||
});
|
});
|
||||||
addTimeouts("hour", {
|
addTimeouts("hour", {
|
||||||
{"1", 1 * 60 * 60}, {"4", 4 * 60 * 60},
|
{"1", 1 * 60 * 60},
|
||||||
|
{"4", 4 * 60 * 60},
|
||||||
});
|
});
|
||||||
addTimeouts("days", {
|
addTimeouts("days", {
|
||||||
{"1", 1 * 60 * 60 * 24}, {"3", 3 * 60 * 60 * 24},
|
{"1", 1 * 60 * 60 * 24},
|
||||||
|
{"3", 3 * 60 * 60 * 24},
|
||||||
});
|
});
|
||||||
addTimeouts("weeks", {
|
addTimeouts("weeks", {
|
||||||
{"1", 1 * 60 * 60 * 24 * 7}, {"2", 2 * 60 * 60 * 24 * 7},
|
{"1", 1 * 60 * 60 * 24 * 7},
|
||||||
|
{"2", 2 * 60 * 60 * 24 * 7},
|
||||||
});
|
});
|
||||||
|
|
||||||
addButton(Ban, "ban", getApp()->resources->buttons.ban);
|
addButton(Ban, "ban", getApp()->resources->buttons.ban);
|
||||||
|
|
|
@ -238,8 +238,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
||||||
// || SettingsDialog::getHandle() == QApplication::activeWindow();
|
// || SettingsDialog::getHandle() == QApplication::activeWindow();
|
||||||
|
|
||||||
QBrush tabBackground = /*this->mouseOver_ ? colors.backgrounds.hover
|
QBrush tabBackground = /*this->mouseOver_ ? colors.backgrounds.hover
|
||||||
:*/ (windowFocused ? colors.backgrounds.regular
|
:*/
|
||||||
: colors.backgrounds.unfocused);
|
(windowFocused ? colors.backgrounds.regular : colors.backgrounds.unfocused);
|
||||||
|
|
||||||
// painter.fillRect(rect(), this->mouseOver_ ? regular.backgrounds.hover
|
// painter.fillRect(rect(), this->mouseOver_ ? regular.backgrounds.hover
|
||||||
// : (windowFocused ? regular.backgrounds.regular
|
// : (windowFocused ? regular.backgrounds.regular
|
||||||
|
|
|
@ -93,8 +93,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *completionModel =
|
auto *completionModel = static_cast<CompletionModel *>(this->completer->model());
|
||||||
static_cast<CompletionModel *>(this->completer->model());
|
|
||||||
|
|
||||||
if (!this->completionInProgress) {
|
if (!this->completionInProgress) {
|
||||||
// First type pressing tab after modifying a message, we refresh our completion model
|
// First type pressing tab after modifying a message, we refresh our completion model
|
||||||
|
|
|
@ -252,8 +252,7 @@ QLayout *AppearancePage::createUiScaleSlider()
|
||||||
|
|
||||||
slider->setMinimum(WindowManager::uiScaleMin);
|
slider->setMinimum(WindowManager::uiScaleMin);
|
||||||
slider->setMaximum(WindowManager::uiScaleMax);
|
slider->setMaximum(WindowManager::uiScaleMax);
|
||||||
slider->setValue(
|
slider->setValue(WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
||||||
WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
|
||||||
|
|
||||||
label->setMinimumWidth(100);
|
label->setMinimumWidth(100);
|
||||||
|
|
||||||
|
@ -261,9 +260,7 @@ QLayout *AppearancePage::createUiScaleSlider()
|
||||||
[](auto value) { getApp()->settings->uiScale.setValue(value); });
|
[](auto value) { getApp()->settings->uiScale.setValue(value); });
|
||||||
|
|
||||||
getApp()->settings->uiScale.connect(
|
getApp()->settings->uiScale.connect(
|
||||||
[label](auto, auto) {
|
[label](auto, auto) { label->setText(QString::number(WindowManager::getUiScaleValue())); },
|
||||||
label->setText(QString::number(WindowManager::getUiScaleValue()));
|
|
||||||
},
|
|
||||||
this->connections_);
|
this->connections_);
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
|
|
|
@ -581,8 +581,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||||
auto _type = _obj.value("type");
|
auto _type = _obj.value("type");
|
||||||
if (_type == "split") {
|
if (_type == "split") {
|
||||||
auto *split = new Split(this);
|
auto *split = new Split(this);
|
||||||
split->setChannel(
|
split->setChannel(WindowManager::decodeChannel(_obj.value("data").toObject()));
|
||||||
WindowManager::decodeChannel(_obj.value("data").toObject()));
|
|
||||||
|
|
||||||
Node *_node = new Node();
|
Node *_node = new Node();
|
||||||
_node->parent = node;
|
_node->parent = node;
|
||||||
|
@ -605,8 +604,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (node->getChildren().size() < 2) {
|
if (node->getChildren().size() < 2) {
|
||||||
auto *split = new Split(this);
|
auto *split = new Split(this);
|
||||||
split->setChannel(
|
split->setChannel(WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||||
WindowManager::decodeChannel(obj.value("data").toObject()));
|
|
||||||
|
|
||||||
this->insertSplit(split, direction, node);
|
this->insertSplit(split, direction, node);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue