From fa0afbb5896be39594e4f416df0b22c208042de1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 9 Nov 2020 16:20:26 +0200 Subject: [PATCH] Fix bug with infinite measurements synchronization. Temporarily remove the path to prevent infinite synchronization after a format conversion. --- src/app/valentina/mainwindow.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index a6c23379e..50208c723 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -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); + } } }