refactor: Remove most raw accesses into Application (#5104)

This commit is contained in:
pajlada
2024-01-19 17:59:55 +01:00
committed by GitHub
parent 326a402710
commit 4380ef8c5f
82 changed files with 552 additions and 452 deletions
+1 -1
View File
@@ -111,7 +111,7 @@ void Fonts::initialize(Settings &, const Paths &)
assertInGuiThread();
// REMOVED
getApp()->windows->incGeneration();
getIApp()->getWindows()->incGeneration();
for (auto &map : this->fontsByType_)
{
+5 -4
View File
@@ -121,7 +121,7 @@ WindowManager::WindowManager(const Paths &paths)
this->saveTimer->setSingleShot(true);
QObject::connect(this->saveTimer, &QTimer::timeout, [] {
getApp()->windows->save();
getIApp()->getWindows()->save();
});
}
@@ -346,9 +346,10 @@ void WindowManager::initialize(Settings &settings, const Paths &paths)
// We can safely ignore this signal connection since both Themes and WindowManager
// share the Application state lifetime
// NOTE: APPLICATION_LIFETIME
std::ignore = getApp()->themes->repaintVisibleChatWidgets_.connect([this] {
this->repaintVisibleChatWidgets();
});
std::ignore =
getIApp()->getThemes()->repaintVisibleChatWidgets_.connect([this] {
this->repaintVisibleChatWidgets();
});
assert(!this->initialized_);
+1 -1
View File
@@ -31,7 +31,7 @@ void GIFTimer::initialize()
this->position_ += GIF_FRAME_LENGTH;
this->signal.invoke();
getApp()->windows->repaintGifEmotes();
getIApp()->getWindows()->repaintGifEmotes();
});
}