Explorar el Código

Make database accesses more quiet by default

Do not print messages on successful database accesses unless
specifically requested.
Steve Pieper hace 13 años
padre
commit
756974e62a
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      Libs/DICOM/Core/ctkDICOMDatabase.cpp

+ 5 - 0
Libs/DICOM/Core/ctkDICOMDatabase.cpp

@@ -80,6 +80,7 @@ public:
   ///
   ///
   bool loggedExec(QSqlQuery& query);
   bool loggedExec(QSqlQuery& query);
   bool loggedExec(QSqlQuery& query, const QString& queryString);
   bool loggedExec(QSqlQuery& query, const QString& queryString);
+  bool LoggedExecVerbose;
 
 
   // dataset must be set always
   // dataset must be set always
   // filePath has to be set if this is an import of an actual file
   // filePath has to be set if this is an import of an actual file
@@ -121,6 +122,7 @@ public:
 ctkDICOMDatabasePrivate::ctkDICOMDatabasePrivate(ctkDICOMDatabase& o): q_ptr(&o)
 ctkDICOMDatabasePrivate::ctkDICOMDatabasePrivate(ctkDICOMDatabase& o): q_ptr(&o)
 {
 {
   this->thumbnailGenerator = NULL;
   this->thumbnailGenerator = NULL;
+  this->LoggedExecVerbose = false;
   this->LastPatientUID = -1;
   this->LastPatientUID = -1;
   this->TagCacheVerified = false;
   this->TagCacheVerified = false;
 }
 }
@@ -179,7 +181,10 @@ bool ctkDICOMDatabasePrivate::loggedExec(QSqlQuery& query, const QString& queryS
     }
     }
   else
   else
     {
     {
+      if (LoggedExecVerbose)
+      {
       logger.debug( "SQL worked!\n SQL: " + query.lastQuery());
       logger.debug( "SQL worked!\n SQL: " + query.lastQuery());
+      }
     }
     }
   return (success);
   return (success);
 }
 }