Kaynağa Gözat

Fixup Windows compilation for ctkErrorLog...

Implement destructor in implementation file (instead of header file) so
that QSharedPointer doesn't complain at compilation time.
Julien Finet 14 yıl önce
ebeveyn
işleme
e90ad33748

+ 6 - 1
Libs/Core/ctkErrorLogFDMessageHandler.cpp

@@ -59,6 +59,11 @@ ctkFDHandler::ctkFDHandler(ctkErrorLogFDMessageHandler* messageHandler,
 }
 }
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
+ctkErrorLogFDMessageHandler::~ctkErrorLogFDMessageHandler()
+{
+}
+
+// --------------------------------------------------------------------------
 FILE* ctkFDHandler::fileDescriptorFromNumber(int fdNumber)
 FILE* ctkFDHandler::fileDescriptorFromNumber(int fdNumber)
 {
 {
   Q_ASSERT(fdNumber == 1 /* stdout*/ || fdNumber == 2 /*stderr*/);
   Q_ASSERT(fdNumber == 1 /* stdout*/ || fdNumber == 2 /*stderr*/);
@@ -125,7 +130,7 @@ void ctkFDHandler::setEnabled(bool value)
     this->OutputFileWatcher.removePath(this->OutputFile.fileName());
     this->OutputFileWatcher.removePath(this->OutputFile.fileName());
 
 
     // Close file and restore standard output to stdout or stderr - which should be the terminal
     // Close file and restore standard output to stdout or stderr - which should be the terminal
-#if Q_OS_WIN32
+#ifdef Q_OS_WIN32
     _dup2(this->SavedFDNumber, _fileno(Self::fileDescriptorFromNumber(this->FDNumber)));
     _dup2(this->SavedFDNumber, _fileno(Self::fileDescriptorFromNumber(this->FDNumber)));
     _close(this->SavedFDNumber);
     _close(this->SavedFDNumber);
 #else
 #else

+ 1 - 0
Libs/Core/ctkErrorLogFDMessageHandler.h

@@ -34,6 +34,7 @@ public:
   typedef ctkErrorLogAbstractMessageHandler Superclass;
   typedef ctkErrorLogAbstractMessageHandler Superclass;
 
 
   ctkErrorLogFDMessageHandler();
   ctkErrorLogFDMessageHandler();
+  virtual ~ctkErrorLogFDMessageHandler();
 
 
   static QString HandlerName;
   static QString HandlerName;
 
 

+ 11 - 0
Libs/Core/ctkErrorLogModel.cpp

@@ -37,6 +37,17 @@
 // ctkErrorLogAbstractMessageHandler methods
 // ctkErrorLogAbstractMessageHandler methods
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
+ctkErrorLogAbstractMessageHandler::ctkErrorLogAbstractMessageHandler()
+  : Enabled(false)
+{
+}
+
+// --------------------------------------------------------------------------
+ctkErrorLogAbstractMessageHandler::~ctkErrorLogAbstractMessageHandler()
+{
+}
+
+// --------------------------------------------------------------------------
 ctkErrorLogModel* ctkErrorLogAbstractMessageHandler::errorLogModel()const
 ctkErrorLogModel* ctkErrorLogAbstractMessageHandler::errorLogModel()const
 {
 {
   return this->ErrorLogModel.data();
   return this->ErrorLogModel.data();

+ 3 - 2
Libs/Core/ctkErrorLogModel.h

@@ -38,8 +38,9 @@ class QStandardItemModel;
 class CTK_CORE_EXPORT ctkErrorLogAbstractMessageHandler
 class CTK_CORE_EXPORT ctkErrorLogAbstractMessageHandler
 {
 {
 public:
 public:
-  ctkErrorLogAbstractMessageHandler():Enabled(false){}
-  virtual ~ctkErrorLogAbstractMessageHandler(){}
+  /// Disabled by default.
+  ctkErrorLogAbstractMessageHandler();
+  virtual ~ctkErrorLogAbstractMessageHandler();
 
 
   ctkErrorLogModel * errorLogModel()const;
   ctkErrorLogModel * errorLogModel()const;
   void setErrorLogModel(ctkErrorLogModel * newErrorLogModel);
   void setErrorLogModel(ctkErrorLogModel * newErrorLogModel);

+ 5 - 0
Libs/Core/ctkErrorLogStreamMessageHandler.cpp

@@ -186,6 +186,11 @@ ctkErrorLogStreamMessageHandler::ctkErrorLogStreamMessageHandler() :
 }
 }
 
 
 // --------------------------------------------------------------------------
 // --------------------------------------------------------------------------
+ctkErrorLogStreamMessageHandler::~ctkErrorLogStreamMessageHandler()
+{
+}
+
+// --------------------------------------------------------------------------
 QString ctkErrorLogStreamMessageHandler::handlerName()const
 QString ctkErrorLogStreamMessageHandler::handlerName()const
 {
 {
   return ctkErrorLogStreamMessageHandler::HandlerName;
   return ctkErrorLogStreamMessageHandler::HandlerName;

+ 3 - 1
Libs/Core/ctkErrorLogStreamMessageHandler.h

@@ -28,12 +28,14 @@
 class ctkErrorLogStreamMessageHandlerPrivate;
 class ctkErrorLogStreamMessageHandlerPrivate;
 
 
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
-class CTK_CORE_EXPORT ctkErrorLogStreamMessageHandler : public ctkErrorLogAbstractMessageHandler
+class CTK_CORE_EXPORT ctkErrorLogStreamMessageHandler
+  : public ctkErrorLogAbstractMessageHandler
 {
 {
 public:
 public:
   typedef ctkErrorLogAbstractMessageHandler Superclass;
   typedef ctkErrorLogAbstractMessageHandler Superclass;
 
 
   ctkErrorLogStreamMessageHandler();
   ctkErrorLogStreamMessageHandler();
+  virtual ~ctkErrorLogStreamMessageHandler();
 
 
   static QString HandlerName;
   static QString HandlerName;