Switch some c-style includes to c++-style includes (i.e. stdint.h to

cstdint)

Make MessageElement to a class to fit better with the derived classes.
Make MessageLayoutElement to a class to fit better with the derived
classes.

Remove virtual from override functions

Replace all instances of boost::signals2 with pajlada::Signals. This
lets us properly use clang code model to check for issues.

Add missing virtual destructor to AbstractIrcServer
Add missing virtual destructor to MessageLayoutElement

Remove unused "connectedConnection" connection in TwitchChannel

Fix typo in TrimChannelName function
Fix typo in MessageParseArgs

Replace some raw pointers with unique pointers where it made more sense.
This allowed us to remove some manually written destructors whose only
purpose was to delete that raw pointer.

Reformat: Add namespace comments
Reformat: Add empty empty lines between main namespace beginning and end
Reformat: Re-order includes
Reformat: Fix some includes that used quotes where they should use angle
brackets
Reformat: Replace some typedef's with using's

Filter out more useless warnings
This commit is contained in:
Rasmus Karlsson
2018-04-03 02:55:32 +02:00
committed by fourtf
parent 1119c08182
commit 6ea3a1df08
103 changed files with 305 additions and 248 deletions
+5 -1
View File
@@ -2,10 +2,12 @@
#include "channel.hpp"
#include <IrcConnection>
#include <IrcMessage>
#include <pajlada/signals/signal.hpp>
#include <functional>
#include <mutex>
#include <pajlada/signals/signal.hpp>
namespace chatterino {
namespace providers {
@@ -14,6 +16,8 @@ namespace irc {
class AbstractIrcServer
{
public:
virtual ~AbstractIrcServer() = default;
// connection
Communi::IrcConnection *getReadConnection() const;
+1 -1
View File
@@ -1,6 +1,6 @@
#pragma once
#include "QString"
#include <QString>
namespace chatterino {
namespace providers {
+3 -2
View File
@@ -1,7 +1,5 @@
#include "ircmessagehandler.hpp"
#include <memory>
#include "debug/log.hpp"
#include "messages/limitedqueue.hpp"
#include "messages/message.hpp"
@@ -12,6 +10,8 @@
#include "singletons/resourcemanager.hpp"
#include "singletons/windowmanager.hpp"
#include <memory>
using namespace chatterino::singletons;
using namespace chatterino::messages;
@@ -233,6 +233,7 @@ void IrcMessageHandler::handleWriteConnectionNoticeMessage(Communi::IrcNoticeMes
this->handleNoticeMessage(message);
}
} // namespace twitch
} // namespace providers
} // namespace chatterino
@@ -13,11 +13,14 @@
//
namespace chatterino {
namespace singletons {
class AccountManager;
}
} // namespace singletons
namespace providers {
namespace twitch {
class TwitchAccountManager
{
TwitchAccountManager();
@@ -62,6 +65,7 @@ private:
friend class chatterino::singletons::AccountManager;
};
} // namespace twitch
} // namespace providers
} // namespace chatterino
+3 -5
View File
@@ -81,8 +81,6 @@ TwitchChannel::TwitchChannel(const QString &channelName, Communi::IrcConnection
TwitchChannel::~TwitchChannel()
{
this->connectedConnection.disconnect();
this->liveStatusTimer->stop();
this->liveStatusTimer->deleteLater();
@@ -103,7 +101,7 @@ bool TwitchChannel::canSendMessage() const
void TwitchChannel::setRoomID(const QString &_roomID)
{
this->roomID = _roomID;
this->roomIDchanged();
this->roomIDchanged.invoke();
this->fetchMessages.invoke();
}
@@ -155,7 +153,7 @@ void TwitchChannel::setMod(bool value)
if (this->mod != value) {
this->mod = value;
this->userStateChanged();
this->userStateChanged.invoke();
}
}
@@ -194,7 +192,7 @@ void TwitchChannel::setLive(bool newLiveStatus)
this->streamStatus.live = newLiveStatus;
}
this->onlineStatusChanged();
this->onlineStatusChanged.invoke();
}
void TwitchChannel::refreshLiveStatus()
+3 -5
View File
@@ -53,11 +53,11 @@ public:
const QString popoutPlayerURL;
void setRoomID(const QString &_roomID);
boost::signals2::signal<void()> roomIDchanged;
boost::signals2::signal<void()> onlineStatusChanged;
pajlada::Signals::NoArgSignal roomIDchanged;
pajlada::Signals::NoArgSignal onlineStatusChanged;
pajlada::Signals::NoArgBoltSignal fetchMessages;
boost::signals2::signal<void()> userStateChanged;
pajlada::Signals::NoArgSignal userStateChanged;
QString roomID;
@@ -89,8 +89,6 @@ private:
void fetchRecentMessages();
boost::signals2::connection connectedConnection;
bool mod;
QByteArray messageSuffix;
QString lastSentMessage;
+1 -1
View File
@@ -8,7 +8,7 @@ namespace twitch {
bool TrimChannelName(const QString &channelName, QString &outChannelName)
{
if (channelName.length() < 3) {
debug::Log("channel name length below 2");
debug::Log("channel name length below 3");
return false;
}