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);
|
||||
|
||||
if (user->isAnon()) {
|
||||
channel->addMessage(Message::createSystemMessage(
|
||||
"You must be logged in to ignore someone"));
|
||||
channel->addMessage(
|
||||
Message::createSystemMessage("You must be logged in to ignore someone"));
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -188,8 +188,8 @@ QString CommandController::execCommand(const QString &text, ChannelPtr channel,
|
|||
auto target = words.at(1);
|
||||
|
||||
if (user->isAnon()) {
|
||||
channel->addMessage(Message::createSystemMessage(
|
||||
"You must be logged in to ignore someone"));
|
||||
channel->addMessage(
|
||||
Message::createSystemMessage("You must be logged in to ignore someone"));
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -38,10 +38,10 @@ void BTTVEmotes::loadGlobalEmotes()
|
|||
EmoteData emoteData;
|
||||
emoteData.image1x = new Image(getEmoteLink(urlTemplate, id, "1x"), 1, code,
|
||||
code + "<br />Global BTTV Emote");
|
||||
emoteData.image2x = new Image(getEmoteLink(urlTemplate, id, "2x"), 0.5,
|
||||
code, code + "<br />Global BTTV Emote");
|
||||
emoteData.image3x = new Image(getEmoteLink(urlTemplate, id, "3x"), 0.25,
|
||||
code, code + "<br />Global BTTV Emote");
|
||||
emoteData.image2x = new Image(getEmoteLink(urlTemplate, id, "2x"), 0.5, code,
|
||||
code + "<br />Global BTTV Emote");
|
||||
emoteData.image3x = new 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);
|
||||
|
@ -89,18 +89,15 @@ void BTTVEmotes::loadChannelEmotes(const QString &channelName, std::weak_ptr<Emo
|
|||
EmoteData emoteData;
|
||||
QString link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image1x =
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "1x"), 1,
|
||||
code, code + "<br />Channel BTTV Emote");
|
||||
emoteData.image1x = new Image(link.replace("{{id}}", id).replace("{{image}}", "1x"),
|
||||
1, code, code + "<br />Channel BTTV Emote");
|
||||
link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image2x =
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
||||
emoteData.image2x = new Image(link.replace("{{id}}", id).replace("{{image}}", "2x"),
|
||||
0.5, code, code + "<br />Channel BTTV Emote");
|
||||
link = linkTemplate;
|
||||
link.detach();
|
||||
emoteData.image3x =
|
||||
new Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
||||
emoteData.image3x = new Image(link.replace("{{id}}", id).replace("{{image}}", "3x"),
|
||||
0.25, code, code + "<br />Channel BTTV Emote");
|
||||
emoteData.pageLink = "https://manage.betterttv.net/emotes/" + id;
|
||||
|
||||
|
|
|
@ -260,8 +260,8 @@ void Emojis::loadEmojiSet()
|
|||
urlPrefix = it->second;
|
||||
}
|
||||
QString url = urlPrefix + code + ".png";
|
||||
emoji->emoteData.image1x = new Image(
|
||||
url, 0.35, emoji->value, ":" + emoji->shortCodes[0] + ":<br/>Emoji");
|
||||
emoji->emoteData.image1x =
|
||||
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");
|
||||
|
||||
if (it != tags.end()) {
|
||||
auto newMessage =
|
||||
Message::createSystemMessage(parseTagString(it.value().toString()));
|
||||
auto newMessage = Message::createSystemMessage(parseTagString(it.value().toString()));
|
||||
|
||||
newMessage->flags |= Message::Subscription;
|
||||
|
||||
|
@ -322,12 +321,22 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
|
|||
void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMessage *message)
|
||||
{
|
||||
static std::unordered_set<std::string> readConnectionOnlyIDs{
|
||||
"host_on", "host_off", "host_target_went_offline", "emote_only_on", "emote_only_off",
|
||||
"slow_on", "slow_off", "subs_on", "subs_off", "r9k_on", "r9k_off",
|
||||
"host_on",
|
||||
"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
|
||||
// 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");
|
||||
|
|
|
@ -194,8 +194,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
|||
// check if you are sending messages too fast
|
||||
if (!lastMessage.empty() && lastMessage.back() + minMessageOffset > now) {
|
||||
if (this->lastErrorTimeSpeed_ + 30s < now) {
|
||||
auto errorMessage =
|
||||
Message::createSystemMessage("sending messages too fast");
|
||||
auto errorMessage = Message::createSystemMessage("sending messages too fast");
|
||||
|
||||
channel->addMessage(errorMessage);
|
||||
|
||||
|
@ -212,8 +211,7 @@ void TwitchServer::onMessageSendRequested(TwitchChannel *channel, const QString
|
|||
// check if you are sending too many messages
|
||||
if (lastMessage.size() >= maxMessageCount) {
|
||||
if (this->lastErrorTimeAmount_ + 30s < now) {
|
||||
auto errorMessage =
|
||||
Message::createSystemMessage("sending too many messages");
|
||||
auto errorMessage = Message::createSystemMessage("sending too many messages");
|
||||
|
||||
channel->addMessage(errorMessage);
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ void Paths::initSubDirectories()
|
|||
|
||||
// create settings subdirectories and validate that they are created properly
|
||||
auto makePath = [&](const std::string &name) -> QString {
|
||||
|
||||
auto path = combinePath(this->rootAppDataDirectory, QString::fromStdString(name));
|
||||
|
||||
if (!QDir().mkpath(path)) {
|
||||
|
|
|
@ -76,8 +76,7 @@ void TooltipWidget::updateFont()
|
|||
{
|
||||
auto app = getApp();
|
||||
|
||||
this->setFont(
|
||||
app->fonts->getFont(Fonts::Type::ChatMediumSmall, this->getScale()));
|
||||
this->setFont(app->fonts->getFont(Fonts::Type::ChatMediumSmall, this->getScale()));
|
||||
}
|
||||
|
||||
void TooltipWidget::setText(QString text)
|
||||
|
|
|
@ -364,9 +364,11 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
|
|||
}
|
||||
a->setBorderColor(color1);
|
||||
|
||||
QObject::connect(a.getElement(), &RippleEffectLabel2::clicked, [
|
||||
this, timeout = std::get<1>(item)
|
||||
] { this->buttonClicked.invoke(std::make_pair(Action::Timeout, timeout)); });
|
||||
QObject::connect(
|
||||
a.getElement(), &RippleEffectLabel2::clicked,
|
||||
[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("min", {
|
||||
{"1", 1 * 60}, {"5", 5 * 60}, {"10", 10 * 60},
|
||||
{"1", 1 * 60},
|
||||
{"5", 5 * 60},
|
||||
{"10", 10 * 60},
|
||||
});
|
||||
addTimeouts("hour", {
|
||||
{"1", 1 * 60 * 60}, {"4", 4 * 60 * 60},
|
||||
{"1", 1 * 60 * 60},
|
||||
{"4", 4 * 60 * 60},
|
||||
});
|
||||
addTimeouts("days", {
|
||||
{"1", 1 * 60 * 60 * 24}, {"3", 3 * 60 * 60 * 24},
|
||||
{"1", 1 * 60 * 60 * 24},
|
||||
{"3", 3 * 60 * 60 * 24},
|
||||
});
|
||||
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);
|
||||
|
|
|
@ -238,8 +238,8 @@ void NotebookTab::paintEvent(QPaintEvent *)
|
|||
// || SettingsDialog::getHandle() == QApplication::activeWindow();
|
||||
|
||||
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
|
||||
// : (windowFocused ? regular.backgrounds.regular
|
||||
|
|
|
@ -93,8 +93,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
|||
return;
|
||||
}
|
||||
|
||||
auto *completionModel =
|
||||
static_cast<CompletionModel *>(this->completer->model());
|
||||
auto *completionModel = static_cast<CompletionModel *>(this->completer->model());
|
||||
|
||||
if (!this->completionInProgress) {
|
||||
// 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->setMaximum(WindowManager::uiScaleMax);
|
||||
slider->setValue(
|
||||
WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
||||
slider->setValue(WindowManager::clampUiScale(getApp()->settings->uiScale.getValue()));
|
||||
|
||||
label->setMinimumWidth(100);
|
||||
|
||||
|
@ -261,9 +260,7 @@ QLayout *AppearancePage::createUiScaleSlider()
|
|||
[](auto value) { getApp()->settings->uiScale.setValue(value); });
|
||||
|
||||
getApp()->settings->uiScale.connect(
|
||||
[label](auto, auto) {
|
||||
label->setText(QString::number(WindowManager::getUiScaleValue()));
|
||||
},
|
||||
[label](auto, auto) { label->setText(QString::number(WindowManager::getUiScaleValue())); },
|
||||
this->connections_);
|
||||
|
||||
return layout;
|
||||
|
|
|
@ -581,8 +581,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
|||
auto _type = _obj.value("type");
|
||||
if (_type == "split") {
|
||||
auto *split = new Split(this);
|
||||
split->setChannel(
|
||||
WindowManager::decodeChannel(_obj.value("data").toObject()));
|
||||
split->setChannel(WindowManager::decodeChannel(_obj.value("data").toObject()));
|
||||
|
||||
Node *_node = new Node();
|
||||
_node->parent = node;
|
||||
|
@ -605,8 +604,7 @@ void SplitContainer::decodeNodeRecusively(QJsonObject &obj, Node *node)
|
|||
for (int i = 0; i < 2; i++) {
|
||||
if (node->getChildren().size() < 2) {
|
||||
auto *split = new Split(this);
|
||||
split->setChannel(
|
||||
WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
split->setChannel(WindowManager::decodeChannel(obj.value("data").toObject()));
|
||||
|
||||
this->insertSplit(split, direction, node);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue