changed .clang-format

This commit is contained in:
fourtf
2018-08-15 22:46:20 +02:00
parent 44c16f1b3a
commit af7b742a23
46 changed files with 1636 additions and 1611 deletions
+49 -49
View File
@@ -39,62 +39,62 @@
namespace chatterino {
namespace {
void addEmoteContextMenuItems(const Emote &emote,
MessageElementFlags creatorFlags, QMenu &menu)
{
auto openAction = menu.addAction("Open");
auto openMenu = new QMenu;
openAction->setMenu(openMenu);
void addEmoteContextMenuItems(const Emote &emote,
MessageElementFlags creatorFlags, QMenu &menu)
{
auto openAction = menu.addAction("Open");
auto openMenu = new QMenu;
openAction->setMenu(openMenu);
auto copyAction = menu.addAction("Copy");
auto copyMenu = new QMenu;
copyAction->setMenu(copyMenu);
auto copyAction = menu.addAction("Copy");
auto copyMenu = new QMenu;
copyAction->setMenu(copyMenu);
// see if the QMenu actually gets destroyed
QObject::connect(openMenu, &QMenu::destroyed, [] {
QMessageBox(QMessageBox::Information, "xD", "the menu got deleted")
.exec();
});
// see if the QMenu actually gets destroyed
QObject::connect(openMenu, &QMenu::destroyed, [] {
QMessageBox(QMessageBox::Information, "xD", "the menu got deleted")
.exec();
});
// Add copy and open links for 1x, 2x, 3x
auto addImageLink = [&](const ImagePtr &image, char scale) {
if (!image->isEmpty()) {
copyMenu->addAction(
QString(scale) + "x link", [url = image->url()] {
QApplication::clipboard()->setText(url.string);
});
openMenu->addAction(
QString(scale) + "x link", [url = image->url()] {
QDesktopServices::openUrl(QUrl(url.string));
});
}
};
addImageLink(emote.images.getImage1(), '1');
addImageLink(emote.images.getImage2(), '2');
addImageLink(emote.images.getImage3(), '3');
// Copy and open emote page link
auto addPageLink = [&](const QString &name) {
copyMenu->addSeparator();
openMenu->addSeparator();
// Add copy and open links for 1x, 2x, 3x
auto addImageLink = [&](const ImagePtr &image, char scale) {
if (!image->isEmpty()) {
copyMenu->addAction(
QString(scale) + "x link", [url = image->url()] {
QApplication::clipboard()->setText(url.string);
"Copy " + name + " emote link", [url = emote.homePage] {
QApplication::clipboard()->setText(url.string); //
});
openMenu->addAction(QString(scale) + "x link",
[url = image->url()] {
QDesktopServices::openUrl(QUrl(url.string));
});
openMenu->addAction(
"Open " + name + " emote link", [url = emote.homePage] {
QDesktopServices::openUrl(QUrl(url.string)); //
});
};
if (creatorFlags.has(MessageElementFlag::BttvEmote)) {
addPageLink("BTTV");
} else if (creatorFlags.has(MessageElementFlag::FfzEmote)) {
addPageLink("FFZ");
}
};
addImageLink(emote.images.getImage1(), '1');
addImageLink(emote.images.getImage2(), '2');
addImageLink(emote.images.getImage3(), '3');
// Copy and open emote page link
auto addPageLink = [&](const QString &name) {
copyMenu->addSeparator();
openMenu->addSeparator();
copyMenu->addAction(
"Copy " + name + " emote link", [url = emote.homePage] {
QApplication::clipboard()->setText(url.string); //
});
openMenu->addAction("Open " + name + " emote link",
[url = emote.homePage] {
QDesktopServices::openUrl(QUrl(url.string)); //
});
};
if (creatorFlags.has(MessageElementFlag::BttvEmote)) {
addPageLink("BTTV");
} else if (creatorFlags.has(MessageElementFlag::FfzEmote)) {
addPageLink("FFZ");
}
}
} // namespace
ChannelView::ChannelView(BaseWidget *parent)