remove the last duplicate findModuleDef from ShipLayoutPreview

ShipLayoutPreview was the one widget the findFooDef sweep missed: it held a
bare const std::vector<ModuleDef>* rather than a config, so the shared
ModulesConfig::findModuleDef was not a drop-in and the file-local copy
survived. Hold the ModulesConfig instead and call the shared finder.

The sole caller already had the ModulesConfig one dereference away.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHcUerKAZKWNvSKJxYKbnG
This commit is contained in:
2026-08-03 21:28:53 +02:00
parent 993325d97c
commit 69848eb9f8
3 changed files with 6 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ public:
void setShipAndLayout(const std::vector<std::string>& shipLayout,
const ShipLayoutConfig& layout,
const std::vector<ModuleDef>* modules);
const ModulesConfig* modules);
void clear();
// Shows an empty placeholder box (no ship layout) so the preview stays
@@ -37,7 +37,7 @@ private:
std::vector<std::vector<CellInfo>> m_grid;
std::vector<PlacedModule> m_placedModules;
const std::vector<ModuleDef>* m_modules;
const ModulesConfig* m_modules;
int m_rows;
int m_cols;
bool m_placeholder = false;