From 5efc2c38d8dd2485bbcf7aa839465bcefa2b76ba Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sun, 6 May 2018 14:16:41 +0200 Subject: [PATCH] Clean up warnings --- chatterino.pro | 1 + src/channel.cpp | 4 ++-- src/controllers/accounts/accountmodel.hpp | 2 +- src/providers/twitch/pubsub.cpp | 2 -- src/singletons/updatemanager.hpp | 2 +- src/widgets/attachedwindow.cpp | 4 ++-- src/widgets/selectchanneldialog.cpp | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/chatterino.pro b/chatterino.pro index cf3576688..bf3578cb0 100644 --- a/chatterino.pro +++ b/chatterino.pro @@ -374,6 +374,7 @@ win32-msvc* { QMAKE_CXXFLAGS_WARN_ON += -Wno-switch QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-declarations QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare + QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable # Disabling strict-aliasing warnings for now, although we probably want to re-enable this in the future QMAKE_CXXFLAGS_WARN_ON += -Wno-strict-aliasing diff --git a/src/channel.cpp b/src/channel.cpp index c98ed6e13..2b7187970 100644 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -21,9 +21,9 @@ using namespace chatterino::messages; namespace chatterino { Channel::Channel(const QString &_name, Type _type) - : type(_type) - , name(_name) + : name(_name) , completionModel(this->name) + , type(_type) { this->clearCompletionModelTimer = new QTimer; QObject::connect(this->clearCompletionModelTimer, &QTimer::timeout, [this]() { diff --git a/src/controllers/accounts/accountmodel.hpp b/src/controllers/accounts/accountmodel.hpp index 67a1ef1ee..40b74750c 100644 --- a/src/controllers/accounts/accountmodel.hpp +++ b/src/controllers/accounts/accountmodel.hpp @@ -1,4 +1,4 @@ -#pragma +#pragma once #include "controllers/accounts/account.hpp" #include "util/signalvectormodel.hpp" diff --git a/src/providers/twitch/pubsub.cpp b/src/providers/twitch/pubsub.cpp index bd8914fad..710334dfb 100644 --- a/src/providers/twitch/pubsub.cpp +++ b/src/providers/twitch/pubsub.cpp @@ -682,8 +682,6 @@ void PubSub::handleListenResponse(const rapidjson::Document &msg) if (rj::getSafe(msg, "error", error)) { std::string nonce; rj::getSafe(msg, "nonce", nonce); - const auto &xd = sentMessages; - const auto &payload = sentMessages[nonce]; if (error.empty()) { debug::Log("Successfully listened to nonce {}", nonce); diff --git a/src/singletons/updatemanager.hpp b/src/singletons/updatemanager.hpp index a52a88d23..f0e6ff657 100644 --- a/src/singletons/updatemanager.hpp +++ b/src/singletons/updatemanager.hpp @@ -1,6 +1,6 @@ #pragma once -#include ; +#include #include namespace chatterino { diff --git a/src/widgets/attachedwindow.cpp b/src/widgets/attachedwindow.cpp index 9e4c6b63c..e8668e2df 100644 --- a/src/widgets/attachedwindow.cpp +++ b/src/widgets/attachedwindow.cpp @@ -16,9 +16,9 @@ namespace chatterino { namespace widgets { AttachedWindow::AttachedWindow(void *_target, int _yOffset) - : target(_target) + : QWidget(nullptr, Qt::FramelessWindowHint | Qt::Window) + , target(_target) , yOffset(_yOffset) - , QWidget(nullptr, Qt::FramelessWindowHint | Qt::Window) { QLayout *layout = new QVBoxLayout(this); layout->setMargin(0); diff --git a/src/widgets/selectchanneldialog.cpp b/src/widgets/selectchanneldialog.cpp index 0a81b1dca..1a0b8a1fc 100644 --- a/src/widgets/selectchanneldialog.cpp +++ b/src/widgets/selectchanneldialog.cpp @@ -233,7 +233,7 @@ bool SelectChannelDialog::EventFilter::eventFilter(QObject *watched, QEvent *eve return true; } else if (((event_key->key() == Qt::Key_Tab || event_key->key() == Qt::Key_Backtab) && event_key->modifiers() == Qt::ShiftModifier) || - (event_key->key() == Qt::Key_Up) && event_key->modifiers() == Qt::NoModifier) { + ((event_key->key() == Qt::Key_Up) && event_key->modifiers() == Qt::NoModifier)) { if (widget == this->dialog->ui.twitch.channelName) { this->dialog->ui.twitch.watching->setFocus(); return true;