From 3cedf4e486d6486555541cdb95c5d9147fd0cdc2 Mon Sep 17 00:00:00 2001 From: Timo Zuccarello Date: Mon, 2 Sep 2024 00:15:25 +0200 Subject: [PATCH] Apply patch from pajlada. --- benchmarks/src/RecentMessages.cpp | 1 + src/Application.cpp | 30 ------------------- src/CMakeLists.txt | 6 ++-- .../pronouns/alejo/PronounsAlejoApi.cpp | 2 +- tests/src/InputCompletion.cpp | 6 ---- tests/src/MessageBuilder.cpp | 7 ----- 6 files changed, 5 insertions(+), 47 deletions(-) diff --git a/benchmarks/src/RecentMessages.cpp b/benchmarks/src/RecentMessages.cpp index fd3461a7d82..994c8885857 100644 --- a/benchmarks/src/RecentMessages.cpp +++ b/benchmarks/src/RecentMessages.cpp @@ -11,6 +11,7 @@ #include "providers/chatterino/ChatterinoBadges.hpp" #include "providers/ffz/FfzBadges.hpp" #include "providers/ffz/FfzEmotes.hpp" +#include "providers/pronouns/Pronouns.hpp" #include "providers/recentmessages/Impl.hpp" #include "providers/seventv/SeventvBadges.hpp" #include "providers/seventv/SeventvEmotes.hpp" diff --git a/src/Application.cpp b/src/Application.cpp index 7f805fa1db3..24dd346fd7a 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -187,36 +187,6 @@ Application::Application(Settings &_settings, const Paths &paths, Application::~Application() { -#ifdef CHATTERINO_HAVE_PLUGINS - this->plugins.reset(); -#endif - this->twitchPubSub.reset(); - this->twitchBadges.reset(); - this->twitchLiveController.reset(); - this->chatterinoBadges.reset(); - this->bttvEmotes.reset(); - this->ffzEmotes.reset(); - this->seventvEmotes.reset(); - this->notifications.reset(); - this->commands.reset(); - // If a crash happens after crashHandler has been reset, we'll assert - // This isn't super different from before, where if the app is already killed, the getApp() portion of it is already dead - this->crashHandler.reset(); - this->seventvAPI.reset(); - this->highlights.reset(); - this->seventvBadges.reset(); - this->ffzBadges.reset(); - // this->twitch.reset(); - this->imageUploader.reset(); - this->hotkeys.reset(); - this->fonts.reset(); - this->sound.reset(); - this->userData.reset(); - this->toasts.reset(); - this->accounts.reset(); - this->emotes.reset(); - this->themes.reset(); - this->pronouns.reset(); // we do this early to ensure getApp isn't used in any dtors INSTANCE = nullptr; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5ed9e245713..8aec2c5bb81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -348,12 +348,12 @@ set(SOURCE_FILES providers/liveupdates/BasicPubSubManager.hpp providers/liveupdates/BasicPubSubWebsocket.hpp - providers/pronouns/Pronouns.hpp providers/pronouns/Pronouns.cpp - providers/pronouns/UserPronouns.hpp + providers/pronouns/Pronouns.hpp providers/pronouns/UserPronouns.cpp - providers/pronouns/alejo/PronounsAlejoApi.hpp + providers/pronouns/UserPronouns.hpp providers/pronouns/alejo/PronounsAlejoApi.cpp + providers/pronouns/alejo/PronounsAlejoApi.hpp providers/recentmessages/Api.cpp providers/recentmessages/Api.hpp diff --git a/src/providers/pronouns/alejo/PronounsAlejoApi.cpp b/src/providers/pronouns/alejo/PronounsAlejoApi.cpp index 0d2cfe834f1..31e606016e0 100644 --- a/src/providers/pronouns/alejo/PronounsAlejoApi.cpp +++ b/src/providers/pronouns/alejo/PronounsAlejoApi.cpp @@ -114,7 +114,7 @@ void AlejoApi::fetch(const QString &username, return; } qCWarning(chatterinoPronouns) - << "alejo.io returned " << status + << "alejo.io returned " << status.value_or(-1) << " when fetching pronouns for " << username; onDone({}); }) diff --git a/tests/src/InputCompletion.cpp b/tests/src/InputCompletion.cpp index cbf4fcc65c8..460fb152630 100644 --- a/tests/src/InputCompletion.cpp +++ b/tests/src/InputCompletion.cpp @@ -69,18 +69,12 @@ class MockApplication : public mock::BaseApplication return &this->seventvEmotes; } - pronouns::Pronouns *getPronouns() override - { - return &this->pronouns; - } - AccountController accounts; mock::MockTwitchIrcServer twitch; Emotes emotes; BttvEmotes bttvEmotes; FfzEmotes ffzEmotes; SeventvEmotes seventvEmotes; - pronouns::Pronouns pronouns; }; } // namespace diff --git a/tests/src/MessageBuilder.cpp b/tests/src/MessageBuilder.cpp index c2a68d16afb..39f01f196a4 100644 --- a/tests/src/MessageBuilder.cpp +++ b/tests/src/MessageBuilder.cpp @@ -91,12 +91,6 @@ class MockApplication : public mock::BaseApplication return &this->seventvEmotes; } - pronouns::Pronouns *getPronouns() override - { - return &this->pronouns; - } - - Settings settings; AccountController accounts; Emotes emotes; mock::UserDataController userData; @@ -108,7 +102,6 @@ class MockApplication : public mock::BaseApplication BttvEmotes bttvEmotes; FfzEmotes ffzEmotes; SeventvEmotes seventvEmotes; - pronouns::Pronouns pronouns; }; } // namespace