summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp')
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index 3171f50c..20cb4428 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -171,6 +171,7 @@ class CDocEditor : public Q3DStudio::IInternalDocumentEditor
Q3DStudio::Foundation::SStudioFoundation m_Foundation;
TStreamFactoryPtr m_InputStreamFactory;
std::unordered_map<long, QT3DSU32> m_GraphOrderMap;
+ bool m_ignoreNextMaterialDefChange = false;
public:
CDocEditor(CDoc &inDoc)
@@ -2037,8 +2038,11 @@ public:
fileInfo.dir().mkpath(QStringLiteral("."));
QFile file(actualSourcePath);
- if ((createNewFile && !file.exists()) || (!createNewFile && file.exists()))
+ if ((createNewFile && !file.exists()) || (!createNewFile && file.exists())) {
+ if (!createNewFile)
+ m_ignoreNextMaterialDefChange = true;
saveMaterial(instance, file);
+ }
return m_Doc.GetRelativePathToDoc(actualSourcePath);
}
@@ -2112,6 +2116,16 @@ public:
writeMaterialFile(material, false);
}
+ bool isIgnoringNextMaterialDefChange() override
+ {
+ return m_ignoreNextMaterialDefChange;
+ }
+
+ void stopIgnoringNextMaterialDefChange() override
+ {
+ m_ignoreNextMaterialDefChange = false;
+ }
+
void saveMaterial(Qt3DSDMInstanceHandle instance, QFile &file)
{
SValue value;