Преглед изворни кода

Remove unused code from ctkErrorLogFDMessageHandler

Both RedirectionFile and RedirectionStream were not used
Jean-Christophe Fillion-Robin пре 12 година
родитељ
комит
ec2f7411a9
2 измењених фајлова са 1 додато и 14 уклоњено
  1. 1 10
      Libs/Core/ctkErrorLogFDMessageHandler.cpp
  2. 0 4
      Libs/Core/ctkErrorLogFDMessageHandler_p.h

+ 1 - 10
Libs/Core/ctkErrorLogFDMessageHandler.cpp

@@ -20,6 +20,7 @@
 
 // Qt includes
 #include <QDebug>
+#include <QFile>
 
 // CTK includes
 #include "ctkErrorLogFDMessageHandler.h"
@@ -57,11 +58,6 @@ ctkFDHandler::ctkFDHandler(ctkErrorLogFDMessageHandler* messageHandler,
 // --------------------------------------------------------------------------
 ctkFDHandler::~ctkFDHandler()
 {
-  if (this->Initialized)
-    {
-    this->RedirectionFile.close();
-    delete this->RedirectionStream;
-    }
 }
 
 // --------------------------------------------------------------------------
@@ -77,8 +73,6 @@ void ctkFDHandler::init()
     qCritical().nospace() << "ctkFDHandler - Failed to create pipe !";
     return;
     }
-  this->RedirectionFile.open(this->Pipe[0], QIODevice::ReadOnly);
-  this->RedirectionStream = new QTextStream(&this->RedirectionFile);
   this->Initialized = true;
 }
 
@@ -126,9 +120,6 @@ void ctkFDHandler::setEnabled(bool value)
     // Flush stdout or stderr so that any buffered messages are delivered
     fflush(this->terminalOutputFile());
 
-    // Flush current stream so that any buffered messages are delivered
-    this->RedirectionFile.flush();
-
     // Stop polling thread
     {
       QMutexLocker locker(&this->EnableMutex);

+ 0 - 4
Libs/Core/ctkErrorLogFDMessageHandler_p.h

@@ -22,7 +22,6 @@
 #define __ctkErrorLogFDMessageHandler_p_h
 
 // Qt includes
-#include <QFile>
 #include <QMutex>
 #include <QThread>
 
@@ -33,7 +32,6 @@
 #include <cstdio>
 
 class ctkErrorLogFDMessageHandler;
-class QTextStream;
 
 // --------------------------------------------------------------------------
 // ctkFDHandler
@@ -75,8 +73,6 @@ private:
   fpos_t SavedFDPos;
 
   int          Pipe[2]; // 0: Read, 1: Write
-  QFile        RedirectionFile;
-  QTextStream* RedirectionStream;
 
   bool Initialized;