MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / restoreSourceSettings

Method restoreSourceSettings

app/src/DataModel/ProjectModel.cpp:1732–1746  ·  view source on GitHub ↗

* @brief Applies the source's saved connectionSettings to its live driver. */

Source from the content-addressed store, hash-verified

1730 * @brief Applies the source's saved connectionSettings to its live driver.
1731 */
1732void 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.

Callers

nothing calls this directly

Calls 4

isEmptyMethod · 0.80
driverForEditingMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected