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
+4 -4
View File
@@ -54,7 +54,7 @@ SettingsDialog::SettingsDialog(QWidget *parent)
this->overrideBackgroundColor_ = QColor("#111111");
this->addShortcuts();
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
this->signalHolder_.managedConnect(getIApp()->getHotkeys()->onItemsUpdated,
[this]() {
this->clearShortcuts();
this->addShortcuts();
@@ -78,13 +78,13 @@ void SettingsDialog::addShortcuts()
{"openTab", nullptr},
};
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(
this->shortcuts_ = getIApp()->getHotkeys()->shortcutsForCategory(
HotkeyCategory::PopupWindow, actions, this);
}
void SettingsDialog::setSearchPlaceholderText()
{
QString searchHotkey;
auto searchSeq = getApp()->hotkeys->getDisplaySequence(
auto searchSeq = getIApp()->getHotkeys()->getDisplaySequence(
HotkeyCategory::PopupWindow, "search");
if (!searchSeq.isEmpty())
{
@@ -432,7 +432,7 @@ void SettingsDialog::onOkClicked()
{
if (!getApp()->getArgs().dontSaveSettings)
{
getApp()->commands->save();
getIApp()->getCommands()->save();
pajlada::Settings::SettingManager::gSave();
}
this->close();