* @brief Applies the source's saved connectionSettings to its live driver. */
| 1730 | * @brief Applies the source's saved connectionSettings to its live driver. |
| 1731 | */ |
| 1732 | void DataModel::ProjectModel::restoreSourceSettings(int sourceId) |
| 1733 | { |
| 1734 | if (sourceId < 0 || sourceId >= static_cast<int>(m_sources.size())) |
| 1735 | return; |
| 1736 | |
| 1737 | const auto& source = m_sources[sourceId]; |
| 1738 | if (source.connectionSettings.isEmpty()) |
| 1739 | return; |
| 1740 | |
| 1741 | IO::HAL_Driver* driver = IO::ConnectionManager::instance().driverForEditing(sourceId); |
| 1742 | if (!driver) |
| 1743 | return; |
| 1744 | |
| 1745 | driver->applyConnectionSettings(source.connectionSettings); |
| 1746 | } |
| 1747 | |
| 1748 | /** |
| 1749 | * @brief Overwrites source[0].connectionSettings without emitting sourcesChanged. |
nothing calls this directly
no test coverage detected