#4538 Skip Save project at exit when no data has changed

Guard changes in preferences and reset change detector when project is closed
This commit is contained in:
Magne Sjaastad
2019-08-07 14:21:37 +02:00
parent 5e2485863c
commit 58cef265ec
5 changed files with 26 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
#include "RiuPropertyViewTabWidget.h"
#include "cafPdmSettings.h"
#include "cafPdmUiModelChangeDetector.h"
#include <QAction>
@@ -65,6 +66,13 @@ void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
caf::PdmSettings::readFieldsFromApplicationStore(app->preferences());
app->preferences()->initAfterReadRecursively();
}
if (!app->isProjectSavedToDisc())
{
// Always reset change detector when modifying preferences, as these changes are irrelevant
// when the project we work on is not saved to disc
caf::PdmUiModelChangeDetector::instance()->reset();
}
}
//--------------------------------------------------------------------------------------------------