Fix bug with infinite measurements synchronization.
Temporarily remove the path to prevent infinite synchronization after a format conversion.
This commit is contained in:
parent
49b43674c3
commit
fa0afbb589
|
@ -1977,12 +1977,12 @@ void MainWindow::SyncMeasurements()
|
||||||
if (mChanges)
|
if (mChanges)
|
||||||
{
|
{
|
||||||
const QString path = AbsoluteMPath(qApp->GetPatternPath(), doc->MPath());
|
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(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");
|
const QString msg = tr("Measurements have been synced");
|
||||||
qCDebug(vMainWindow, "%s", qUtf8Printable(msg));
|
qCDebug(vMainWindow, "%s", qUtf8Printable(msg));
|
||||||
statusBar()->showMessage(msg, 5000);
|
statusBar()->showMessage(msg, 5000);
|
||||||
|
@ -1998,6 +1998,11 @@ void MainWindow::SyncMeasurements()
|
||||||
{
|
{
|
||||||
qCWarning(vMainWindow, "%s", qUtf8Printable(tr("Couldn't sync measurements.")));
|
qCWarning(vMainWindow, "%s", qUtf8Printable(tr("Couldn't sync measurements.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (not watcher->files().contains(path))
|
||||||
|
{
|
||||||
|
watcher->addPath(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user