diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2024-06-09 12:18:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-09 12:18:17 +0200 |
| commit | 88c386d74d7d94ec16d4d84ed674eb51e31647ac (patch) | |
| tree | adf0b2537f12d11d8df77f68a84926d15b063554 /src/savestab.cpp | |
| parent | c43535f5bcf1043c3b9c00c77967267cf1acf60f (diff) | |
Refactoring of game features for better management. (#2043)
Diffstat (limited to 'src/savestab.cpp')
| -rw-r--r-- | src/savestab.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/savestab.cpp b/src/savestab.cpp index 813fea05..2cbd17de 100644 --- a/src/savestab.cpp +++ b/src/savestab.cpp @@ -62,8 +62,7 @@ void SavesTab::displaySaveGameInfo(QTreeWidgetItem* newItem) } if (m_CurrentSaveView == nullptr) { - const IPluginGame* game = m_core.managedGame(); - const SaveGameInfo* info = game->feature<SaveGameInfo>(); + auto info = m_core.gameFeatures().gameFeature<SaveGameInfo>(); if (info != nullptr) { m_CurrentSaveView = info->getSaveGameWidget(m_window); @@ -199,7 +198,7 @@ void SavesTab::refreshSaveList() void SavesTab::deleteSavegame() { - SaveGameInfo const* info = m_core.managedGame()->feature<SaveGameInfo>(); + auto info = m_core.gameFeatures().gameFeature<SaveGameInfo>(); QString savesMsgLabel; QStringList deleteFiles; @@ -246,7 +245,7 @@ void SavesTab::onContextMenu(const QPoint& pos) QMenu menu; - SaveGameInfo const* info = this->m_core.managedGame()->feature<SaveGameInfo>(); + auto info = m_core.gameFeatures().gameFeature<SaveGameInfo>(); if (info != nullptr) { QAction* action = menu.addAction(tr("Fix enabled mods...")); action->setEnabled(false); @@ -304,7 +303,7 @@ void SavesTab::fixMods(SaveGameInfo::MissingAssets const& missingAssets) void SavesTab::openInExplorer() { - const SaveGameInfo* info = m_core.managedGame()->feature<SaveGameInfo>(); + auto info = m_core.gameFeatures().gameFeature<SaveGameInfo>(); const auto sel = ui.list->selectionModel()->selectedRows(); if (sel.empty()) { |
