Skip to content
Snippets Groups Projects
Commit 330e3843 authored by Tobias Gröger's avatar Tobias Gröger
Browse files

ScenarioManager: ignore any file changes made by us

parent 7b1e1f10
Branches fix/reload-on-property-edit
No related tags found
1 merge request!101ScenarioManager: Fix reload on property edit
Pipeline #20515 passed
......@@ -1049,8 +1049,10 @@ DetailedApplicationView::on_fileUpdate()
lastAppInstance->save();
}
// we want to ignore any file changes made by us to avoid unnecessarily updating the GUI
ignoreFileChanges = true;
emit saveScenario(lastAppInstance);
ignoreFileChanges = false;
}
else if (lastScenario.get() != nullptr)
{
......@@ -1097,6 +1099,12 @@ DetailedApplicationView::on_makeLocalButton_clicked()
void
DetailedApplicationView::on_fileWatcherUpdate(const QString& path)
{
if (ignoreFileChanges)
{
ARMARX_VERBOSE << "Ignoring file change from: " << path.toStdString();
return;
}
ARMARX_VERBOSE << "File changed: " << path.toStdString() << " -> reloading config";
if (lastAppInstance.get() != nullptr)
......
......@@ -155,6 +155,7 @@ private:
QTimer updateTimer;
QFileSystemWatcher fileSystemWatcher;
bool ignoreFileChanges = false;
};
using DetailedApplicationViewPtr = std::shared_ptr<DetailedApplicationView>;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment