Fix warnings/reformat some code
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
#include "widgets/textinputdialog.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
#include <QFont>
|
||||
#include <QFontDatabase>
|
||||
#include <QPainter>
|
||||
#include <QProcess>
|
||||
#include <QShortcut>
|
||||
#include <QVBoxLayout>
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
#include <functional>
|
||||
@@ -40,12 +40,12 @@ ChatWidget::ChatWidget(ChannelManager &_channelManager, NotebookPage *parent)
|
||||
: BaseWidget(parent)
|
||||
, channelManager(_channelManager)
|
||||
, completionManager(parent->completionManager)
|
||||
, channelName("/chatWidgets/" + std::to_string(index++) + "/channelName")
|
||||
, channel(_channelManager.emptyChannel)
|
||||
, vbox(this)
|
||||
, header(this)
|
||||
, view(this)
|
||||
, input(this)
|
||||
, channelName("/chatWidgets/" + std::to_string(index++) + "/channelName")
|
||||
{
|
||||
this->vbox.setSpacing(0);
|
||||
this->vbox.setMargin(1);
|
||||
@@ -288,9 +288,9 @@ void ChatWidget::doOpenStreamlink()
|
||||
// TODO(Confuseh): Add quality switcher
|
||||
if (fileinfo.exists() && fileinfo.isExecutable()) {
|
||||
// works on leenux, idk whether it would work on whindows or mehOS
|
||||
QProcess::startDetached(path,
|
||||
QStringList({"twitch.tv/" + QString::fromStdString(this->channelName.getValue()),
|
||||
"best"}));
|
||||
QProcess::startDetached(
|
||||
path, QStringList({"twitch.tv/" + QString::fromStdString(this->channelName.getValue()),
|
||||
"best"}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,15 @@ public:
|
||||
void giveFocus(Qt::FocusReason reason);
|
||||
bool hasFocus() const;
|
||||
|
||||
pajlada::Settings::Setting<std::string> channelName;
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
|
||||
public:
|
||||
ChannelManager &channelManager;
|
||||
CompletionManager &completionManager;
|
||||
|
||||
pajlada::Settings::Setting<std::string> channelName;
|
||||
|
||||
private:
|
||||
void setChannel(std::shared_ptr<Channel> newChannel);
|
||||
void detachChannel();
|
||||
|
||||
@@ -31,13 +31,13 @@ LoginWidget::LoginWidget()
|
||||
this->close(); //
|
||||
});
|
||||
|
||||
connect(&this->ui.loginButton, &QPushButton::clicked, [this]() {
|
||||
connect(&this->ui.loginButton, &QPushButton::clicked, []() {
|
||||
printf("open login in browser\n");
|
||||
QDesktopServices::openUrl(QUrl("https://pajlada.se/chatterino/#chatterino"));
|
||||
|
||||
});
|
||||
|
||||
connect(&this->ui.pasteCodeButton, &QPushButton::clicked, [this]() {
|
||||
connect(&this->ui.pasteCodeButton, &QPushButton::clicked, []() {
|
||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||
QString clipboardString = clipboard->text();
|
||||
QStringList parameters = clipboardString.split(';');
|
||||
|
||||
@@ -168,7 +168,7 @@ void SettingsDialog::addTabs()
|
||||
auto fontManager = FontManager::getInstance();
|
||||
QFontDialog dialog(fontManager.getFont(FontManager::Medium));
|
||||
|
||||
dialog.connect(&dialog, &QFontDialog::fontSelected, [&dialog](const QFont &font) {
|
||||
dialog.connect(&dialog, &QFontDialog::fontSelected, [](const QFont &font) {
|
||||
auto fontManager = FontManager::getInstance();
|
||||
fontManager.currentFontFamily = font.family().toStdString();
|
||||
fontManager.currentFontSize = font.pointSize();
|
||||
@@ -590,9 +590,7 @@ QLineEdit *SettingsDialog::createLineEdit(pajlada::Settings::Setting<std::string
|
||||
auto widget = new QLineEdit(QString::fromStdString(setting.getValue()));
|
||||
|
||||
QObject::connect(widget, &QLineEdit::textChanged, this,
|
||||
[&setting](const QString &newValue) {
|
||||
setting = newValue.toStdString();
|
||||
});
|
||||
[&setting](const QString &newValue) { setting = newValue.toStdString(); });
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user