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:
@@ -552,7 +552,7 @@ util::EmoteData EmoteManager::getCheerImage(long long amount, bool animated)
|
||||
return util::EmoteData();
|
||||
}
|
||||
|
||||
boost::signals2::signal<void()> &EmoteManager::getGifUpdateSignal()
|
||||
pajlada::Signals::NoArgSignal &EmoteManager::getGifUpdateSignal()
|
||||
{
|
||||
if (!this->gifUpdateTimerInitiated) {
|
||||
this->gifUpdateTimerInitiated = true;
|
||||
@@ -571,7 +571,7 @@ boost::signals2::signal<void()> &EmoteManager::getGifUpdateSignal()
|
||||
});
|
||||
|
||||
QObject::connect(&this->gifUpdateTimer, &QTimer::timeout, [this] {
|
||||
this->gifUpdateTimerSignal();
|
||||
this->gifUpdateTimerSignal.invoke();
|
||||
// fourtf:
|
||||
auto &windowManager = singletons::WindowManager::getInstance();
|
||||
windowManager.repaintGifEmotes();
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QTimer>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
_generation++;
|
||||
}
|
||||
|
||||
boost::signals2::signal<void()> &getGifUpdateSignal();
|
||||
pajlada::Signals::NoArgSignal &getGifUpdateSignal();
|
||||
|
||||
// Bit badge/emotes?
|
||||
util::ConcurrentMap<QString, messages::Image *> miscImageCache;
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
/// Chatterino emotes
|
||||
util::EmoteMap _chatterinoEmotes;
|
||||
|
||||
boost::signals2::signal<void()> gifUpdateTimerSignal;
|
||||
pajlada::Signals::NoArgSignal gifUpdateTimerSignal;
|
||||
QTimer gifUpdateTimer;
|
||||
bool gifUpdateTimerInitiated = false;
|
||||
|
||||
|
||||
@@ -105,5 +105,6 @@ FontManager::Font &FontManager::getCurrentFont(float scale)
|
||||
|
||||
return this->currentFontByScale.back().second;
|
||||
}
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -137,7 +137,9 @@ private:
|
||||
|
||||
int generation = 0;
|
||||
};
|
||||
|
||||
} // namespace singletons
|
||||
|
||||
typedef singletons::FontManager::Type FontStyle;
|
||||
using FontStyle = singletons::FontManager::Type;
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
|
||||
static void _registerSetting(std::weak_ptr<pajlada::Settings::ISettingData> setting);
|
||||
|
||||
template <typename Type>
|
||||
@@ -71,5 +72,6 @@ public:
|
||||
return this->getValue();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -46,5 +46,6 @@ const QString &ModerationAction::getAction() const
|
||||
{
|
||||
return this->action;
|
||||
}
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
namespace messages {
|
||||
class Image;
|
||||
}
|
||||
} // namespace messages
|
||||
|
||||
namespace singletons {
|
||||
|
||||
class ModerationAction
|
||||
@@ -27,5 +29,6 @@ private:
|
||||
QString line2;
|
||||
QString action;
|
||||
};
|
||||
|
||||
} // namespace singletons
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <QColor>
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
@@ -156,7 +156,7 @@ void ThemeManager::actuallyUpdate(double hue, double multiplier)
|
||||
// Selection
|
||||
this->messages.selection = isLightTheme() ? QColor(0, 0, 0, 64) : QColor(255, 255, 255, 64);
|
||||
|
||||
this->updated();
|
||||
this->updated.invoke();
|
||||
}
|
||||
|
||||
QColor ThemeManager::blendColors(const QColor &color1, const QColor &color2, qreal ratio)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "util/serialize-custom.hpp"
|
||||
|
||||
#include <QBrush>
|
||||
#include <QColor>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include "util/serialize-custom.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace singletons {
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
|
||||
void update();
|
||||
|
||||
boost::signals2::signal<void()> updated;
|
||||
pajlada::Signals::NoArgSignal updated;
|
||||
|
||||
pajlada::Settings::Setting<QString> themeName;
|
||||
pajlada::Settings::Setting<double> themeHue;
|
||||
|
||||
@@ -58,7 +58,7 @@ void WindowManager::initMainWindow()
|
||||
|
||||
void WindowManager::layoutVisibleChatWidgets(Channel *channel)
|
||||
{
|
||||
this->layout(channel);
|
||||
this->layout.invoke(channel);
|
||||
}
|
||||
|
||||
void WindowManager::repaintVisibleChatWidgets(Channel *channel)
|
||||
@@ -70,7 +70,7 @@ void WindowManager::repaintVisibleChatWidgets(Channel *channel)
|
||||
|
||||
void WindowManager::repaintGifEmotes()
|
||||
{
|
||||
this->repaintGifs();
|
||||
this->repaintGifs.invoke();
|
||||
}
|
||||
|
||||
// void WindowManager::updateAll()
|
||||
|
||||
@@ -32,8 +32,8 @@ public:
|
||||
|
||||
void save();
|
||||
|
||||
boost::signals2::signal<void()> repaintGifs;
|
||||
boost::signals2::signal<void(Channel *)> layout;
|
||||
pajlada::Signals::NoArgSignal repaintGifs;
|
||||
pajlada::Signals::Signal<Channel *> layout;
|
||||
|
||||
private:
|
||||
ThemeManager &themeManager;
|
||||
|
||||
Reference in New Issue
Block a user