refactor: Use override instead of virtual where possible (#4917)

This commit is contained in:
pajlada
2023-10-25 18:13:48 +02:00
committed by GitHub
parent da31e47f9a
commit 5c0219c245
54 changed files with 193 additions and 203 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class AbstractIrcServer : public QObject
public:
enum ConnectionType { Read = 1, Write = 2, Both = 3 };
virtual ~AbstractIrcServer() = default;
~AbstractIrcServer() override = default;
// initializeIrc must be called from the derived class
// this allows us to initialize the abstract IRC server based on the derived class's parameters
+4 -2
View File
@@ -18,6 +18,7 @@
namespace chatterino {
namespace {
QString configPath()
{
return combinePath(getPaths()->settingsDirectory, "irc.json");
@@ -33,7 +34,7 @@ namespace {
// turn a vector item into a model row
IrcServerData getItemFromRow(std::vector<QStandardItem *> &row,
const IrcServerData &original)
const IrcServerData &original) override
{
return IrcServerData{
row[0]->data(Qt::EditRole).toString(), // host
@@ -50,7 +51,7 @@ namespace {
// turns a row in the model into a vector item
void getRowFromItem(const IrcServerData &item,
std::vector<QStandardItem *> &row)
std::vector<QStandardItem *> &row) override
{
setStringItem(row[0], item.host, false);
setStringItem(row[1], QString::number(item.port));
@@ -60,6 +61,7 @@ namespace {
setStringItem(row[5], item.real);
}
};
} // namespace
inline QString escape(QString str)
+3 -3
View File
@@ -8,7 +8,7 @@ namespace chatterino {
class Irc;
class IrcServer;
class IrcChannel : public Channel, public ChannelChatters
class IrcChannel final : public Channel, public ChannelChatters
{
public:
explicit IrcChannel(const QString &name, IrcServer *server);
@@ -19,8 +19,8 @@ public:
IrcServer *server();
// Channel methods
virtual bool canReconnect() const override;
virtual void reconnect() override;
bool canReconnect() const override;
void reconnect() override;
private:
void setServer(IrcServer *server);