Salome HOME
[bos#35161][EDF](2023-T1) Automatic backup
[modules/gui.git] / src / SUIT / SUIT_Study.cxx
index 5f62d04be8e1383bdb9f1ba0ff3ecf13596812d2..04cebe76158b58856a72589d5bfa602578b08c1f 100644 (file)
 #include "SUIT_MessageBox.h"
 #include "SUIT_Application.h"
 
+//---------------------------------------------------------
+#define USE_DEBUG
+//#define MB_IGNORE_QT
+//#define MB_FULL_DUMP
+#define MBCLASSNAME "SUIT_Study"
+#include "MBDebug.h"
+// <-- insert includes for addtional debug headers here!
+//---------------------------------------------------------
+
 /*!\class SUIT_Study
  * Support study management. Object management. Operation management.
  */
@@ -41,9 +50,11 @@ myIsSaved( false ),
 myIsModified( false ),
 myBlockChangeState( false )
 {
+  DBG_FUN();
   static int _id = 0;
 
   myId = ++_id;
+  SHOW(myId);
 
   myRoot = new SUIT_DataObject();
 }
@@ -51,6 +62,7 @@ myBlockChangeState( false )
 /*!Destructor.*/
 SUIT_Study::~SUIT_Study()
 {
+  DBG_FUN();
   delete myRoot;
   myRoot = 0;
 }
@@ -142,11 +154,19 @@ bool SUIT_Study::openDocument( const QString& fileName )
 /*!
  * Save document as \a fileName. Set file name.
  */
-bool SUIT_Study::saveDocumentAs( const QString& fileName )
-{
-  myName = fileName;
-  myIsSaved = true;
-  myIsModified = false;
+bool SUIT_Study::saveDocumentAs( const QString& fileName, bool isBackup/*=false*/ )
+{
+  DBG_FUN();
+  ARG(fileName);
+  ARG(isBackup);
+  if (!isBackup) {
+    myName = fileName;
+    myIsSaved = true;
+    myIsModified = false;
+  }
+  SHOW(myName);
+  SHOW(myIsSaved);
+  SHOW(myIsModified);
 
   return true;
 }
@@ -156,6 +176,7 @@ bool SUIT_Study::saveDocumentAs( const QString& fileName )
  */
 bool SUIT_Study::saveDocument()
 {
+  DBG_FUN();
   return saveDocumentAs( myName );
 }