MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / setAutoReload

Method setAutoReload

src/core/DxccColorProvider.cpp:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void DxccColorProvider::setAutoReload(bool on, const QString& path)
89{
90 // Remove any existing watched file and directory paths
91 if (!m_fileWatcher.files().isEmpty())
92 m_fileWatcher.removePaths(m_fileWatcher.files());
93 if (!m_fileWatcher.directories().isEmpty())
94 m_fileWatcher.removePaths(m_fileWatcher.directories());
95 m_debounceTimer.stop();
96
97 if (on && !path.isEmpty()) {
98 m_watchedPath = path;
99 m_fileWatcher.addPath(path); // watch the file (exists now)
100 // Watch the parent directory so we catch delete-then-recreate:
101 // if the file is removed and a new one dropped in later, the directory
102 // watcher fires and re-arms the file watcher when the file reappears.
103 const QString dir = QFileInfo(path).absolutePath();
104 m_fileWatcher.addPath(dir);
105 } else {
106 m_watchedPath.clear();
107 }
108}
109
110void DxccColorProvider::onParseFinished(QVector<QsoRecord> records)
111{

Callers 2

MainWindowMethod · 0.80
buildDisplayTabMethod · 0.80

Calls 3

isEmptyMethod · 0.45
stopMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected