Quellcode durchsuchen

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 vor 14 Jahren
Ursprung
Commit
e90ad33748

+ 6 - 1
Libs/Core/ctkErrorLogFDMessageHandler.cpp

@@ -59,6 +59,11 @@ ctkFDHandler::ctkFDHandler(ctkErrorLogFDMessageHandler* messageHandler,
 }
 
 // --------------------------------------------------------------------------
+ctkErrorLogFDMessageHandler::~ctkErrorLogFDMessageHandler()
+{
+}
+
+// --------------------------------------------------------------------------
 FILE* ctkFDHandler::fileDescriptorFromNumber(int fdNumber)
 {
   Q_ASSERT(fdNumber == 1 /* stdout*/ || fdNumber == 2 /*stderr*/);
@@ -125,7 +130,7 @@ void ctkFDHandler::setEnabled(bool value)
     this->OutputFileWatcher.removePath(this->OutputFile.fileName());
 
     // 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)));
     _close(this->SavedFDNumber);
 #else

+ 1 - 0
Libs/Core/ctkErrorLogFDMessageHandler.h

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

+ 11 - 0
Libs/Core/ctkErrorLogModel.cpp

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

+ 3 - 2
Libs/Core/ctkErrorLogModel.h

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

+ 5 - 0
Libs/Core/ctkErrorLogStreamMessageHandler.cpp

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

+ 3 - 1
Libs/Core/ctkErrorLogStreamMessageHandler.h

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