![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <QSet>#include <QString>Go to the source code of this file.
Classes | |
| struct | openswmmvis::SaveAsPathResult |
Namespaces | |
| namespace | openswmmvis |
Functions | |
| SaveAsPathResult | openswmmvis::normalizeSaveAsPath (const QString &dialogPath, const QSet< QString > &writableExtensions) |
Save As dialog result canonicalization (Slice RA, Phase RA.1).
The Save As dialog can return paths with stacked extensions like model.inp.oswp (when the dialog's selectFile() pre-fill carries a .inp and the user then picks a .oswp filter without clearing the basename — see §R.1 of GUI_IMPLEMENTATION_PLAN.md). Downstream code in SWMMVis::onSaveAs uses QFileInfo::completeBaseName() which strips only the last extension, producing model.inp.inp for the .inp save and model.inp.oswp for the sidecar — both undesired.
normalizeSaveAsPath() collapses any <ext>.<ext> duplication where both halves are known writable kinds, then computes the canonical inpPath and isProject flag the way onSaveAs needs them. The helper is intentionally a pure function over the dialog string + a writable- extensions set so the unit test (test_saveaspathnormalizer.cpp) can exercise it without spinning up the dialog or FileFilterRegistry.