refactor: Un-singletonize Paths & Updates (#5092)
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <QUrl>
|
||||
|
||||
namespace chatterino {
|
||||
void ChatterinoBadges::initialize(Settings &settings, Paths &paths)
|
||||
void ChatterinoBadges::initialize(Settings &settings, const Paths &paths)
|
||||
{
|
||||
this->loadChatterinoBadges();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ using EmotePtr = std::shared_ptr<const Emote>;
|
||||
class ChatterinoBadges : public Singleton
|
||||
{
|
||||
public:
|
||||
void initialize(Settings &settings, Paths &paths) override;
|
||||
void initialize(Settings &settings, const Paths &paths) override;
|
||||
ChatterinoBadges();
|
||||
|
||||
std::optional<EmotePtr> getBadge(const UserId &id);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
void FfzBadges::initialize(Settings &settings, Paths &paths)
|
||||
void FfzBadges::initialize(Settings &settings, const Paths &paths)
|
||||
{
|
||||
this->load();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ using EmotePtr = std::shared_ptr<const Emote>;
|
||||
class FfzBadges : public Singleton
|
||||
{
|
||||
public:
|
||||
void initialize(Settings &settings, Paths &paths) override;
|
||||
void initialize(Settings &settings, const Paths &paths) override;
|
||||
FfzBadges() = default;
|
||||
|
||||
struct Badge {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Irc2.hpp"
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "common/Credentials.hpp"
|
||||
#include "common/SignalVectorModel.hpp"
|
||||
#include "providers/irc/IrcChannel2.hpp"
|
||||
@@ -21,7 +22,7 @@ namespace {
|
||||
|
||||
QString configPath()
|
||||
{
|
||||
return combinePath(getPaths()->settingsDirectory, "irc.json");
|
||||
return combinePath(getIApp()->getPaths().settingsDirectory, "irc.json");
|
||||
}
|
||||
|
||||
class Model : public SignalVectorModel<IrcServerData>
|
||||
|
||||
@@ -64,7 +64,7 @@ TwitchIrcServer::TwitchIrcServer()
|
||||
// false);
|
||||
}
|
||||
|
||||
void TwitchIrcServer::initialize(Settings &settings, Paths &paths)
|
||||
void TwitchIrcServer::initialize(Settings &settings, const Paths &paths)
|
||||
{
|
||||
getApp()->accounts->twitch.currentUserChanged.connect([this]() {
|
||||
postToThread([this] {
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
TwitchIrcServer();
|
||||
~TwitchIrcServer() override = default;
|
||||
|
||||
void initialize(Settings &settings, Paths &paths) override;
|
||||
void initialize(Settings &settings, const Paths &paths) override;
|
||||
|
||||
void forEachChannelAndSpecialChannels(std::function<void(ChannelPtr)> func);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user