changeset 13639:b643c51ca0f7

Removed useless code.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Mon, 22 Aug 2011 22:32:07 +0200
parents c6574e6cc8a6
children bad5cb3cfe20
files gui/octave-gui.pro gui/src/terminal/Pty.cpp gui/src/terminal/Pty.h gui/src/terminal/kpty_export.h gui/src/terminal/kptydevice.h gui/src/terminal/kptyprocess.h
diffstat 6 files changed, 3 insertions(+), 208 deletions(-) [+]
line wrap: on
line diff
--- a/gui/octave-gui.pro	Mon Aug 22 22:15:26 2011 +0200
+++ b/gui/octave-gui.pro	Mon Aug 22 22:32:07 2011 +0200
@@ -86,7 +86,6 @@
         src/terminal/Pty.h \
         src/terminal/kpty.h \
         src/terminal/kpty_p.h \
-		  src/terminal/kpty_export.h \
         src/terminal/kptyprocess.h \
         src/terminal/kprocess.h \
         src/terminal/kptydevice.h \
--- a/gui/src/terminal/Pty.cpp	Mon Aug 22 22:15:26 2011 +0200
+++ b/gui/src/terminal/Pty.cpp	Mon Aug 22 22:32:07 2011 +0200
@@ -19,7 +19,6 @@
 */
 
 // Own
-#include "kprocess_p.h"
 #include "kptyprocess.h"
 #include "Pty.h"
 
@@ -37,98 +36,6 @@
 #include "kpty.h"
 #include "kptydevice.h"
 
-
-void
-Pty::setWindowSize (int lines, int cols)
-{
-  _windowColumns = cols;
-  _windowLines = lines;
-
-  if (pty ()->masterFd () >= 0)
-    pty ()->setWinSize (lines, cols);
-}
-
-QSize
-Pty::windowSize () const
-{
-  return QSize (_windowColumns, _windowLines);
-}
-
-void
-Pty::setFlowControlEnabled (bool enable)
-{
-  _xonXoff = enable;
-
-  if (pty ()->masterFd () >= 0)
-    {
-      struct::termios ttmode;
-      pty ()->tcGetAttr (&ttmode);
-      if (!enable)
-	ttmode.c_iflag &= ~(IXOFF | IXON);
-      else
-	ttmode.c_iflag |= (IXOFF | IXON);
-      pty()->tcSetAttr(&ttmode);
-    }
-}
-
-bool
-Pty::flowControlEnabled () const
-{
-  if (pty ()->masterFd () >= 0)
-    {
-      struct::termios ttmode;
-      pty ()->tcGetAttr (&ttmode);
-      return ttmode.c_iflag & IXOFF && ttmode.c_iflag & IXON;
-    }
-  return false;
-}
-
-void
-Pty::setUtf8Mode (bool enable)
-{
-#ifdef IUTF8
-  _utf8 = enable;
-
-  if (pty ()->masterFd () >= 0)
-    {
-      struct::termios ttmode;
-      pty ()->tcGetAttr (&ttmode);
-      if (!enable)
-	ttmode.c_iflag &= ~IUTF8;
-      else
-	ttmode.c_iflag |= IUTF8;
-      pty()->tcSetAttr(&ttmode);
-    }
-#endif
-}
-
-void
-Pty::setErase (char erase)
-{
-  _eraseChar = erase;
-
-  if (pty ()->masterFd () >= 0)
-    {
-      struct::termios ttmode;
-      pty ()->tcGetAttr (&ttmode);
-      ttmode.c_cc[VERASE] = erase;
-      pty()->tcSetAttr(&ttmode);
-    }
-}
-
-char
-Pty::erase () const
-{
-  if (pty ()->masterFd () >= 0)
-    {
-      struct::termios ttyAttributes;
-      pty ()->tcGetAttr (&ttyAttributes);
-      return ttyAttributes.c_cc[VERASE];
-    }
-
-  return _eraseChar;
-}
-
 int
 Pty::start (const QString & program,
             const QStringList & programArguments)
@@ -142,18 +49,9 @@
     ttmode.c_iflag &= ~(IXOFF | IXON);
   else
     ttmode.c_iflag |= (IXOFF | IXON);
-#ifdef IUTF8			// XXX not a reasonable place to check it.
-  if (!_utf8)
-    ttmode.c_iflag &= ~IUTF8;
-  else
-    ttmode.c_iflag |= IUTF8;
-#endif
 
-  if (_eraseChar != 0)
-    ttmode.c_cc[VERASE] = _eraseChar;
 
   pty ()->tcSetAttr(&ttmode);
-  pty ()->setWinSize (_windowLines, _windowColumns);
 
   KProcess::start ();
 
@@ -162,17 +60,6 @@
   return 0;
 }
 
-void
-Pty::setWriteable (bool writeable)
-{
-  struct stat sbuf;
-  ::stat (pty ()->ttyName (), &sbuf);
-  if (writeable)
-    chmod (pty ()->ttyName (), sbuf.st_mode | S_IWGRP);
-  else
-    chmod (pty ()->ttyName (), sbuf.st_mode & ~(S_IWGRP | S_IWOTH));
-}
-
 Pty::Pty (int masterFd, QObject * parent):
 KPtyProcess (masterFd, parent)
 {
@@ -187,11 +74,7 @@
 void
 Pty::init ()
 {
-  _windowColumns = 0;
-  _windowLines = 0;
-  _eraseChar = 0;
   _xonXoff = true;
-  _utf8 = true;
 
   connect (pty (), SIGNAL (readyRead ()), this, SLOT (dataReceived ()));
   setPtyChannels (KPtyProcess::AllChannels);
--- a/gui/src/terminal/Pty.h	Mon Aug 22 22:15:26 2011 +0200
+++ b/gui/src/terminal/Pty.h	Mon Aug 22 22:32:07 2011 +0200
@@ -30,7 +30,6 @@
 #include <QtCore/QSize>
 
 // KDE
-#include "kprocess.h"
 #include "kptyprocess.h"
 
 /**
@@ -46,7 +45,6 @@
  * To start the terminal process, call the start() method
  * with the program name and appropriate arguments. 
  */
-//class KONSOLEPRIVATE_EXPORT Pty: public KPtyProcess
 class Pty:public KPtyProcess
 {
 Q_OBJECT public:
@@ -85,40 +83,7 @@
   int start (const QString & program,
              const QStringList & arguments);
 
-    /** TODO: Document me */
-  void setWriteable (bool writeable);
-
-    /** 
-     * Enables or disables Xon/Xoff flow control.  The flow control setting
-     * may be changed later by a terminal application, so flowControlEnabled()
-     * may not equal the value of @p on in the previous call to setFlowControlEnabled()
-     */
-  void setFlowControlEnabled (bool on);
-
-    /** Queries the terminal state and returns true if Xon/Xoff flow control is enabled. */
-  bool flowControlEnabled () const;
-
-    /** 
-     * Sets the size of the window (in lines and columns of characters) 
-     * used by this teletype.
-     */
-  void setWindowSize (int lines, int cols);
-
-    /** Returns the size of the window used by this teletype.  See setWindowSize() */
-  QSize windowSize () const;
-
-    /** TODO Document me */
-  void setErase (char erase);
-
-    /** */
-  char erase () const;
-
   public slots:
-    /**
-     * Put the pty into UTF-8 mode on systems which support it.
-     */
-  void setUtf8Mode (bool on);
-
     /** 
      * Sends data to the process currently controlling the 
      * teletype ( whose id is returned by foregroundProcessGroup() )
@@ -137,18 +102,13 @@
 protected:
   void setupChildProcess ();
 
-  private slots:
-    // called when data is received from the terminal process 
+private slots:
+  // called when data is received from the terminal process
   void dataReceived ();
 
 private:
   void init ();
-
-  int _windowColumns;
-  int _windowLines;
-  char _eraseChar;
   bool _xonXoff;
-  bool _utf8;
 };
 
 #endif // PTY_H
--- a/gui/src/terminal/kpty_export.h	Mon Aug 22 22:15:26 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2007 David Faure <faure@kde.org>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef KPTY_EXPORT_H
-#define KPTY_EXPORT_H
-
-/* needed for KDE_EXPORT and KDE_IMPORT macros */
-//#include <kdemacros.h>
-#include <QtCore/qglobal.h>
-#define KDE_EXPORT
-#define KDE_IMPORT
-
-#ifndef KPTY_EXPORT
-#if defined(KDELIBS_STATIC_LIBS)
-   /* No export/import for static libraries */
-#define KPTY_EXPORT
-#elif defined(MAKE_KDECORE_LIB)
-   /* We are building this library */
-#define KPTY_EXPORT KDE_EXPORT
-#else
-   /* We are using this library */
-#define KPTY_EXPORT KDE_IMPORT
-#endif
-#endif
-
-#ifndef KPTY_EXPORT_DEPRECATED
-#define KPTY_EXPORT_DEPRECATED KDE_DEPRECATED KPTY_EXPORT
-#endif
-
-#endif
--- a/gui/src/terminal/kptydevice.h	Mon Aug 22 22:15:26 2011 +0200
+++ b/gui/src/terminal/kptydevice.h	Mon Aug 22 22:32:07 2011 +0200
@@ -38,7 +38,7 @@
  * Encapsulates KPty into a QIODevice, so it can be used with Q*Stream, etc.
  */
 class KPtyDevice:public QIODevice, public KPty
-{				//krazy:exclude=dpointer (via macro)
+{
 Q_OBJECT Q_DECLARE_PRIVATE_MI (KPtyDevice, KPty) public:
 
     /**
--- a/gui/src/terminal/kptyprocess.h	Mon Aug 22 22:15:26 2011 +0200
+++ b/gui/src/terminal/kptyprocess.h	Mon Aug 22 22:32:07 2011 +0200
@@ -23,7 +23,6 @@
 #define KPTYPROCESS_H
 
 #include "kprocess.h"
-#include "kprocess_p.h"
 #include "kptydevice.h"
 
 class KPtyDevice;