refactor: make Application::imageUploader private

This commit is contained in:
Rasmus Karlsson 2024-01-18 23:42:15 +01:00
parent 51cfb8d369
commit 7629190589
3 changed files with 11 additions and 8 deletions

View file

@ -405,6 +405,13 @@ IChatterinoBadges *Application::getChatterinoBadges()
return this->chatterinoBadges.get(); return this->chatterinoBadges.get();
} }
ImageUploader *Application::getImageUploader()
{
assertInGuiThread();
return this->imageUploader;
}
ITwitchIrcServer *Application::getTwitch() ITwitchIrcServer *Application::getTwitch()
{ {
assertInGuiThread(); assertInGuiThread();

View file

@ -134,9 +134,9 @@ private:
HotkeyController *const hotkeys{}; HotkeyController *const hotkeys{};
WindowManager *const windows{}; WindowManager *const windows{};
Toasts *const toasts{}; Toasts *const toasts{};
ImageUploader *const imageUploader{};
public: public:
ImageUploader *const imageUploader{};
SeventvAPI *const seventvAPI{}; SeventvAPI *const seventvAPI{};
CrashHandler *const crashHandler{}; CrashHandler *const crashHandler{};
@ -210,12 +210,7 @@ public:
ITwitchLiveController *getTwitchLiveController() override; ITwitchLiveController *getTwitchLiveController() override;
TwitchBadges *getTwitchBadges() override; TwitchBadges *getTwitchBadges() override;
IChatterinoBadges *getChatterinoBadges() override; IChatterinoBadges *getChatterinoBadges() override;
ImageUploader *getImageUploader() override ImageUploader *getImageUploader() override;
{
assertInGuiThread();
return this->imageUploader;
}
SeventvAPI *getSeventvAPI() override SeventvAPI *getSeventvAPI() override
{ {
assertInGuiThread(); assertInGuiThread();

View file

@ -427,7 +427,8 @@ Split::Split(QWidget *parent)
} }
} }
QPointer<ResizingTextEdit> edit = this->input_->ui_.textEdit; QPointer<ResizingTextEdit> edit = this->input_->ui_.textEdit;
getApp()->imageUploader->upload(source, this->getChannel(), edit); getIApp()->getImageUploader()->upload(source, this->getChannel(),
edit);
}); });
getSettings()->imageUploaderEnabled.connect( getSettings()->imageUploaderEnabled.connect(