MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / switchToSavedSource

Method switchToSavedSource

src/controller.cpp:1863–1882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1861}
1862
1863void RcxController::switchToSavedSource(int idx) {
1864 if (idx < 0 || idx >= m_savedSources.size()) return;
1865 if (idx == m_activeSourceIdx) return;
1866
1867 // Save current source's base address before switching
1868 if (m_activeSourceIdx >= 0 && m_activeSourceIdx < m_savedSources.size())
1869 m_savedSources[m_activeSourceIdx].baseAddress = m_doc->tree.baseAddress;
1870
1871 m_activeSourceIdx = idx;
1872 const auto& entry = m_savedSources[idx];
1873
1874 if (entry.kind == QStringLiteral("File")) {
1875 m_doc->loadData(entry.filePath);
1876 m_doc->tree.baseAddress = entry.baseAddress;
1877 refresh();
1878 } else if (!entry.providerTarget.isEmpty()) {
1879 // Plugin-based provider (e.g. "processmemory" with target "pid:name")
1880 attachViaPlugin(entry.kind, entry.providerTarget);
1881 }
1882}
1883
1884void RcxController::pushSavedSourcesToEditors() {
1885 QVector<SavedSourceDisplay> display;

Callers

nothing calls this directly

Calls 2

loadDataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected