Mercurial > hg > octave-nkf
changeset 13459:6b66ab238c26
Removed unnecessay code.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sun, 17 Apr 2011 11:20:30 +0200 |
parents | 16d26344c2a2 |
children | ca7e10760df6 |
files | gui//Quint.pro gui//src/Emulation.cpp gui//src/Emulation.h gui//src/KeyboardTranslator.cpp gui//src/KeyboardTranslator.h gui//src/MainWindow.h gui//src/Pty.h gui//src/Session.cpp gui//src/Session.h gui//src/TerminalDisplay.cpp gui//src/TerminalDisplay.h gui//src/Vt102Emulation.cpp |
diffstat | 12 files changed, 14 insertions(+), 195 deletions(-) [+] |
line wrap: on
line diff
--- a/gui//Quint.pro +++ b/gui//Quint.pro @@ -74,7 +74,6 @@ src/QTerminalWidget.h \ src/MainWindow.h \ src/OctaveLink.h \ - src/konsole_export.h \ src/ProcessInfo.h \ src/kpty_export.h \ src/OctaveTerminal.h \
--- a/gui//src/Emulation.cpp +++ b/gui//src/Emulation.cpp @@ -194,7 +194,7 @@ { // A block of text // Note that the text is proper unicode. // We should do a conversion here - emit sendData(ev->text().toUtf8(),ev->text().length()); + emit sendData(ev->text().toUtf8(), ev->text().length()); } }
--- a/gui//src/Emulation.h +++ b/gui//src/Emulation.h @@ -28,13 +28,10 @@ // Qt #include <QtGui/QKeyEvent> -//#include <QPointer> #include <QtCore/QTextCodec> #include <QtCore/QTextStream> #include <QtCore/QTimer> -// Konsole -#include "konsole_export.h" class KeyboardTranslator; class HistoryType; @@ -116,7 +113,7 @@ * how long the emulation has been active/idle for and also respond to * a 'bell' event in different ways. */ -class KONSOLEPRIVATE_EXPORT Emulation : public QObject +class Emulation : public QObject { Q_OBJECT
--- a/gui//src/KeyboardTranslator.cpp +++ b/gui//src/KeyboardTranslator.cpp @@ -37,13 +37,6 @@ #include <QtCore/QDebug> #include <QtCore/QDataStream> -// KDE -#include "konsole_export.h" -//#include <KDebug> -//#include <KLocale> -//#include <KStandardDirs> -//#include "kdebug.h" - const QByteArray KeyboardTranslatorManager::defaultTranslatorText( "keyboard \"Fallback Key Translator\"\n" "key Tab : \"\\t\"" @@ -241,7 +234,7 @@ { QList<Token> tokens = tokenize( QString(source->readLine()) ); if ( !tokens.isEmpty() && tokens.first().type == Token::TitleKeyword ) - _description = i18n(tokens[1].text.toLatin1().data()); + _description = QString(tokens[1].text.toLatin1().data()); } // read first entry (if any) readNext();
--- a/gui//src/KeyboardTranslator.h +++ b/gui//src/KeyboardTranslator.h @@ -29,9 +29,6 @@ #include <QtCore/QMetaType> #include <QtCore/QVarLengthArray> -// Konsole -#include "konsole_export.h" - class QIODevice; class QTextStream; @@ -439,7 +436,7 @@ * Manages the keyboard translations available for use by terminal sessions, * see KeyboardTranslator. */ -class KONSOLEPRIVATE_EXPORT KeyboardTranslatorManager +class KeyboardTranslatorManager { public: /**
--- a/gui//src/MainWindow.h +++ b/gui//src/MainWindow.h @@ -137,8 +137,7 @@ void run() { int argc = 3; const char* argv[] = {"octave", "--interactive", "--line-editing"}; - octave_main(argc, (char**)argv,1); - switch_to_buffer(create_buffer(get_input_from_stdin())); + octave_main(argc, (char**)argv, 1); main_loop(); clean_up_and_exit(0); }
--- a/gui//src/Pty.h +++ b/gui//src/Pty.h @@ -30,13 +30,9 @@ #include <QtCore/QSize> // KDE -//#include <KPtyProcess> #include "kprocess.h" #include "kptyprocess.h" -// Konsole -#include "konsole_export.h" - /** * The Pty class is used to start the terminal process, * send data to it, receive data from it and manipulate @@ -51,7 +47,7 @@ * with the program name and appropriate arguments. */ //class KONSOLEPRIVATE_EXPORT Pty: public KPtyProcess -class KONSOLEPRIVATE_EXPORT Pty: public KPtyProcess +class Pty: public KPtyProcess { Q_OBJECT
--- a/gui//src/Session.cpp +++ b/gui//src/Session.cpp @@ -382,8 +382,7 @@ void Session::terminalWarning(const QString& message) { - //static const QByteArray warningText = i18nc("@info:shell Alert the user with red color text", "Warning: ").toLocal8Bit(); - static const QByteArray warningText = i18nc("@info:shell Alert the user with red color text", "Warning: "); + static const QByteArray warningText = QByteArray("@info:shell Alert the user with red color text"); QByteArray messageText = message.toLocal8Bit(); static const char redPenOn[] = "\033[1m\033[31m"; @@ -446,7 +445,7 @@ // if none of the choices are available, print a warning else if (choice == CHOICE_COUNT) { - terminalWarning(i18n("Could not find an interactive shell to start.")); + terminalWarning(QString("Could not find an interactive shell to start.")); return; } @@ -632,7 +631,7 @@ { if (state==NOTIFYBELL) { - emit bellRequest( i18n("Bell in session '%1'",_nameTitle.toLatin1().data()) ); + emit bellRequest(QString("Bell in session '%1'").arg(_nameTitle.toLatin1().data())); } else if (state==NOTIFYACTIVITY) { @@ -787,7 +786,7 @@ { if (!_autoClose) { - _userTitle = i18n("@info:shell This session is done", "Finished"); + _userTitle = QString("@info:shell This session is done"); emit titleChanged(); return; } @@ -952,45 +951,6 @@ return title; } -/* -KUrl Session::getUrl() -{ - QString path; - - updateSessionProcessInfo(); - if (_sessionProcessInfo->isValid()) - { - bool ok = false; - - // check if foreground process is bookmark-able - if (isForegroundProcessActive()) - { - // for remote connections, save the user and host - // bright ideas to get the directory at the other end are welcome :) - if (_foregroundProcessInfo->name(&ok) == "ssh" && ok) - { - SSHProcessInfo sshInfo(*_foregroundProcessInfo); - path = "ssh://" + sshInfo.userName() + '@' + sshInfo.host(); - } - else - { - path = _foregroundProcessInfo->currentDir(&ok); - if (!ok) - path.clear(); - } - } - else // otherwise use the current working directory of the shell process - { - path = _sessionProcessInfo->currentDir(&ok); - if (!ok) - path.clear(); - } - } - - return KUrl(path); -} -*/ - void Session::setIconName(const QString& iconName) { if ( iconName != _iconName ) @@ -1098,122 +1058,6 @@ return _flowControl; } -/* -void Session::fireZModemDetected() -{ - if (!_zmodemBusy) - { - QTimer::singleShot(10, this, SIGNAL(zmodemDetected())); - _zmodemBusy = true; - } -} - -void Session::cancelZModem() -{ - _shellProcess->sendData("\030\030\030\030", 4); // Abort - _zmodemBusy = false; -} - -void Session::startZModem(const QString &zmodem, const QString &dir, const QStringList &list) -{ - _zmodemBusy = true; - _zmodemProc = new KProcess(); - _zmodemProc->setOutputChannelMode( KProcess::SeparateChannels ); - - *_zmodemProc << zmodem << "-v" << list; - - if (!dir.isEmpty()) - _zmodemProc->setWorkingDirectory(dir); - - connect(_zmodemProc,SIGNAL (readyReadStandardOutput()), - this, SLOT(zmodemReadAndSendBlock())); - connect(_zmodemProc,SIGNAL (readyReadStandardError()), - this, SLOT(zmodemReadStatus())); - connect(_zmodemProc,SIGNAL (finished(int,QProcess::ExitStatus)), - this, SLOT(zmodemFinished())); - - _zmodemProc->start(); - - disconnect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); - connect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(zmodemRcvBlock(const char*,int)) ); - - _zmodemProgress = new ZModemDialog(QApplication::activeWindow(), false, - i18n("ZModem Progress")); - - connect(_zmodemProgress, SIGNAL(user1Clicked()), - this, SLOT(zmodemFinished())); - - _zmodemProgress->show(); -} - -void Session::zmodemReadAndSendBlock() -{ - _zmodemProc->setReadChannel( QProcess::StandardOutput ); - QByteArray data = _zmodemProc->readAll(); - - if ( data.count() == 0 ) - return; - - _shellProcess->sendData(data.constData(),data.count()); -} - -void Session::zmodemReadStatus() -{ - _zmodemProc->setReadChannel( QProcess::StandardError ); - QByteArray msg = _zmodemProc->readAll(); - while(!msg.isEmpty()) - { - int i = msg.indexOf('\015'); - int j = msg.indexOf('\012'); - QByteArray txt; - if ((i != -1) && ((j == -1) || (i < j))) - { - msg = msg.mid(i+1); - } - else if (j != -1) - { - txt = msg.left(j); - msg = msg.mid(j+1); - } - else - { - txt = msg; - msg.truncate(0); - } - if (!txt.isEmpty()) - _zmodemProgress->addProgressText(QString::fromLocal8Bit(txt)); - } -} - -void Session::zmodemRcvBlock(const char *data, int len) -{ - QByteArray ba( data, len ); - - _zmodemProc->write( ba ); -} - -void Session::zmodemFinished() -{ - // zmodemFinished() is called by QProcess's finished() and - // ZModemDialog's user1Clicked(). Therefore, an invocation by - // user1Clicked() will recursively invoke this function again - // when the KProcess is deleted! - if (_zmodemProc) { - KProcess* process = _zmodemProc; - _zmodemProc = 0; // Set _zmodemProc to 0 avoid recursive invocations! - _zmodemBusy = false; - delete process; // Now, the KProcess may be disposed safely. - - disconnect( _shellProcess,SIGNAL(receivedData(const char*,int)), this ,SLOT(zmodemRcvBlock(const char*,int)) ); - connect( _shellProcess,SIGNAL(receivedData(const char*,int)), this, SLOT(onReceiveBlock(const char*,int)) ); - - _shellProcess->sendData("\030\030\030\030", 4); // Abort - _shellProcess->sendData("\001\013\n", 3); // Try to get prompt back - _zmodemProgress->transferDone(); - } -} -*/ - void Session::onReceiveBlock( const char* buf, int len ) { _emulation->receiveData( buf, len );
--- a/gui//src/Session.h +++ b/gui//src/Session.h @@ -31,11 +31,6 @@ #include <QUuid> #include <QWidget> -// KDE -//#include <KApplication> -//#include <KMainWindow> -#include "konsole_export.h" - // Konsole #include "History.h"
--- a/gui//src/TerminalDisplay.cpp +++ b/gui//src/TerminalDisplay.cpp @@ -1127,8 +1127,8 @@ } if (!_resizeWidget) { - _resizeWidget = new QLabel(i18n("Size: XXX x XXX"), this); - _resizeWidget->setMinimumWidth(_resizeWidget->fontMetrics().width(i18n("Size: XXX x XXX"))); + _resizeWidget = new QLabel(QString("Size: XXX x XXX"), this); + _resizeWidget->setMinimumWidth(_resizeWidget->fontMetrics().width(QString("Size: XXX x XXX"))); _resizeWidget->setMinimumHeight(_resizeWidget->sizeHint().height()); _resizeWidget->setAlignment(Qt::AlignCenter); @@ -2884,7 +2884,7 @@ //all terminal emulators. //If there isn't a suitable article available in the target language the link //can simply be removed. - _outputSuspendedLabel = new QLabel( i18n("<qt>Output has been " + _outputSuspendedLabel = new QLabel( QString("<qt>Output has been " "<a href=\"http://en.wikipedia.org/wiki/Flow_control\">suspended</a>" " by pressing Ctrl+S." " Press <b>Ctrl+Q</b> to resume.</qt>"),
--- a/gui//src/TerminalDisplay.h +++ b/gui//src/TerminalDisplay.h @@ -29,7 +29,6 @@ // Konsole #include "Filter.h" #include "Character.h" -#include "konsole_export.h" class QDrag; class QDragEnterEvent;
--- a/gui//src/Vt102Emulation.cpp +++ b/gui//src/Vt102Emulation.cpp @@ -958,7 +958,7 @@ { // print an error message to the terminal if no key translator has been // set - QString translatorError = i18n("No keyboard translator available. " + QString translatorError = QString("No keyboard translator available. " "The information needed to convert key presses " "into characters to send to the terminal " "is missing.");