Fix bug with infinite measurements synchronization.

Temporarily remove the path to prevent infinite synchronization after a format conversion.
This commit is contained in:
Roman Telezhynskyi 2020-11-09 16:20:26 +02:00
parent 49b43674c3
commit fa0afbb589

View File

@ -1977,12 +1977,12 @@ void MainWindow::SyncMeasurements()
if (mChanges)
{
const QString path = AbsoluteMPath(qApp->GetPatternPath(), doc->MPath());
// Temporarily remove the path to prevent infinite synchronization after a format conversion.
watcher->removePath(path);
if(UpdateMeasurements(path, m_currentDimensionA, m_currentDimensionB, m_currentDimensionC))
{
if (not watcher->files().contains(path))
{
watcher->addPath(path);
}
const QString msg = tr("Measurements have been synced");
qCDebug(vMainWindow, "%s", qUtf8Printable(msg));
statusBar()->showMessage(msg, 5000);
@ -1998,6 +1998,11 @@ void MainWindow::SyncMeasurements()
{
qCWarning(vMainWindow, "%s", qUtf8Printable(tr("Couldn't sync measurements.")));
}
if (not watcher->files().contains(path))
{
watcher->addPath(path);
}
}
}