From 88c386d74d7d94ec16d4d84ed674eb51e31647ac Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 9 Jun 2024 12:18:17 +0200 Subject: Refactoring of game features for better management. (#2043) --- src/savestab.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/savestab.cpp') 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(); + auto info = m_core.gameFeatures().gameFeature(); 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(); + auto info = m_core.gameFeatures().gameFeature(); QString savesMsgLabel; QStringList deleteFiles; @@ -246,7 +245,7 @@ void SavesTab::onContextMenu(const QPoint& pos) QMenu menu; - SaveGameInfo const* info = this->m_core.managedGame()->feature(); + auto info = m_core.gameFeatures().gameFeature(); 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(); + auto info = m_core.gameFeatures().gameFeature(); const auto sel = ui.list->selectionModel()->selectedRows(); if (sel.empty()) { -- cgit v1.3.1