From 76291905895b197cf7db1cc8c9875414e93ca754 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Thu, 18 Jan 2024 23:42:15 +0100 Subject: [PATCH] refactor: make Application::imageUploader private --- src/Application.cpp | 7 +++++++ src/Application.hpp | 9 ++------- src/widgets/splits/Split.cpp | 3 ++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index c4d820313..28165b3fa 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -405,6 +405,13 @@ IChatterinoBadges *Application::getChatterinoBadges() return this->chatterinoBadges.get(); } +ImageUploader *Application::getImageUploader() +{ + assertInGuiThread(); + + return this->imageUploader; +} + ITwitchIrcServer *Application::getTwitch() { assertInGuiThread(); diff --git a/src/Application.hpp b/src/Application.hpp index 10ce3b217..a9258eb44 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -134,9 +134,9 @@ private: HotkeyController *const hotkeys{}; WindowManager *const windows{}; Toasts *const toasts{}; + ImageUploader *const imageUploader{}; public: - ImageUploader *const imageUploader{}; SeventvAPI *const seventvAPI{}; CrashHandler *const crashHandler{}; @@ -210,12 +210,7 @@ public: ITwitchLiveController *getTwitchLiveController() override; TwitchBadges *getTwitchBadges() override; IChatterinoBadges *getChatterinoBadges() override; - ImageUploader *getImageUploader() override - { - assertInGuiThread(); - - return this->imageUploader; - } + ImageUploader *getImageUploader() override; SeventvAPI *getSeventvAPI() override { assertInGuiThread(); diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 48cc812e7..78e683d7a 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -427,7 +427,8 @@ Split::Split(QWidget *parent) } } QPointer edit = this->input_->ui_.textEdit; - getApp()->imageUploader->upload(source, this->getChannel(), edit); + getIApp()->getImageUploader()->upload(source, this->getChannel(), + edit); }); getSettings()->imageUploaderEnabled.connect(