diff --git a/lang/quardCRT_ar_SA.ts b/lang/quardCRT_ar_SA.ts index 86543a1c..1dac90f9 100644 --- a/lang/quardCRT_ar_SA.ts +++ b/lang/quardCRT_ar_SA.ts @@ -2900,7 +2900,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_cs_CZ.ts b/lang/quardCRT_cs_CZ.ts index abfac8c0..d124b968 100644 --- a/lang/quardCRT_cs_CZ.ts +++ b/lang/quardCRT_cs_CZ.ts @@ -2900,7 +2900,7 @@ Pokud potřebujete použít jiný shell, vytvořte prosím relaci prostřednictv - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ Pokud potřebujete použít jiný shell, vytvořte prosím relaci prostřednictv - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ Pokud potřebujete použít jiný shell, vytvořte prosím relaci prostřednictv - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ Pokud potřebujete použít jiný shell, vytvořte prosím relaci prostřednictv - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_de_DE.ts b/lang/quardCRT_de_DE.ts index 1ed40851..3ca56e17 100644 --- a/lang/quardCRT_de_DE.ts +++ b/lang/quardCRT_de_DE.ts @@ -2900,7 +2900,7 @@ Wenn Sie eine andere Shell verwenden müssen, erstellen Sie bitte eine Sitzung - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ Wenn Sie eine andere Shell verwenden müssen, erstellen Sie bitte eine Sitzung - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ Wenn Sie eine andere Shell verwenden müssen, erstellen Sie bitte eine Sitzung - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ Wenn Sie eine andere Shell verwenden müssen, erstellen Sie bitte eine Sitzung - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_en_US.ts b/lang/quardCRT_en_US.ts index 060fac10..bf8f154c 100644 --- a/lang/quardCRT_en_US.ts +++ b/lang/quardCRT_en_US.ts @@ -2896,7 +2896,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Session + Session Bell in session '%1' @@ -2904,7 +2904,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2932,7 +2932,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2945,7 +2945,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_es_ES.ts b/lang/quardCRT_es_ES.ts index 2d885c72..ac1437a6 100644 --- a/lang/quardCRT_es_ES.ts +++ b/lang/quardCRT_es_ES.ts @@ -2900,7 +2900,7 @@ Si necesita usar otro shell, cree una sesión a través de [conexión rápida &g - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ Si necesita usar otro shell, cree una sesión a través de [conexión rápida &g - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ Si necesita usar otro shell, cree una sesión a través de [conexión rápida &g - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ Si necesita usar otro shell, cree una sesión a través de [conexión rápida &g - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_fr_FR.ts b/lang/quardCRT_fr_FR.ts index c70f9c65..cf39fc90 100644 --- a/lang/quardCRT_fr_FR.ts +++ b/lang/quardCRT_fr_FR.ts @@ -2900,7 +2900,7 @@ Si vous avez besoin d'utiliser un autre shell, veuillez créer une session - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ Si vous avez besoin d'utiliser un autre shell, veuillez créer une session - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ Si vous avez besoin d'utiliser un autre shell, veuillez créer une session - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ Si vous avez besoin d'utiliser un autre shell, veuillez créer une session - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_ja_JP.ts b/lang/quardCRT_ja_JP.ts index 80626a7f..5dd30fde 100644 --- a/lang/quardCRT_ja_JP.ts +++ b/lang/quardCRT_ja_JP.ts @@ -2900,7 +2900,7 @@ PowerShell 5以降を使用してください! - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ PowerShell 5以降を使用してください! - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ PowerShell 5以降を使用してください! - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ PowerShell 5以降を使用してください! - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_ko_KR.ts b/lang/quardCRT_ko_KR.ts index 2f06388e..3f9bf470 100644 --- a/lang/quardCRT_ko_KR.ts +++ b/lang/quardCRT_ko_KR.ts @@ -2900,7 +2900,7 @@ PowerShell 5 이상을 사용하십시오! - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ PowerShell 5 이상을 사용하십시오! - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ PowerShell 5 이상을 사용하십시오! - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ PowerShell 5 이상을 사용하십시오! - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_pt_BR.ts b/lang/quardCRT_pt_BR.ts index fdf16db1..df7f5b33 100644 --- a/lang/quardCRT_pt_BR.ts +++ b/lang/quardCRT_pt_BR.ts @@ -2900,7 +2900,7 @@ Se você precisar usar outro shell, crie uma sessão através de [conexão rápi - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ Se você precisar usar outro shell, crie uma sessão através de [conexão rápi - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ Se você precisar usar outro shell, crie uma sessão através de [conexão rápi - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ Se você precisar usar outro shell, crie uma sessão através de [conexão rápi - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_ru_RU.ts b/lang/quardCRT_ru_RU.ts index 6fb7de23..f2311b2d 100644 --- a/lang/quardCRT_ru_RU.ts +++ b/lang/quardCRT_ru_RU.ts @@ -2900,7 +2900,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_zh_CN.ts b/lang/quardCRT_zh_CN.ts index 904160cc..69f38ce6 100644 --- a/lang/quardCRT_zh_CN.ts +++ b/lang/quardCRT_zh_CN.ts @@ -2900,7 +2900,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lang/quardCRT_zh_HK.ts b/lang/quardCRT_zh_HK.ts index de4ef99c..87e60137 100644 --- a/lang/quardCRT_zh_HK.ts +++ b/lang/quardCRT_zh_HK.ts @@ -2900,7 +2900,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Session + Session Bell in session '%1' @@ -2908,7 +2908,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::TerminalDisplay + TerminalDisplay Size: XXX x XXX @@ -2936,7 +2936,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::UrlFilter + UrlFilter Follow link (ctrl + click) @@ -2949,7 +2949,7 @@ If you need to use another shell, please create a session through [quick-connect - Konsole::Vt102Emulation + Vt102Emulation No keyboard translator available. The information needed to convert key presses into characters to send to the terminal is missing. diff --git a/lib/ptyqt/unixptyprocess.cpp b/lib/ptyqt/unixptyprocess.cpp index 27ea6c43..843bca68 100644 --- a/lib/ptyqt/unixptyprocess.cpp +++ b/lib/ptyqt/unixptyprocess.cpp @@ -327,12 +327,16 @@ bool UnixPtyProcess::hasChildProcess() UnixPtyProcess::pidTree_t UnixPtyProcess::processInfoTree() { QList psInfoList; - QString cmd = QString("ps"); + QString cmd("ps"); QStringList args = { "-o", "pid,ppid,command", "-ax" }; QProcess ps; ps.start(cmd, args); - ps.waitForFinished(-1); + bool isOk = ps.waitForFinished(); QString psResult = ps.readAllStandardOutput(); + if((!isOk) || psResult.isEmpty()) { + pidTree_t tree = { { m_pid, 0, m_shellPath, QStringList() }, QList() }; + return tree; + } QStringList psLines = psResult.split("\n"); foreach (QString line, psLines) { diff --git a/lib/qtermwidget/BlockArray.cpp b/lib/qtermwidget/BlockArray.cpp index c7a288e1..dce84b66 100644 --- a/lib/qtermwidget/BlockArray.cpp +++ b/lib/qtermwidget/BlockArray.cpp @@ -20,13 +20,10 @@ 02110-1301 USA. */ - #include -// Own #include "BlockArray.h" -// System #if defined(Q_OS_WIN) #include #if defined(Q_CC_GNU) @@ -48,9 +45,6 @@ #endif #include - -using namespace Konsole; - static int blocksize = 0; BlockArray::BlockArray() diff --git a/lib/qtermwidget/BlockArray.h b/lib/qtermwidget/BlockArray.h index f015423a..b3cc6de1 100644 --- a/lib/qtermwidget/BlockArray.h +++ b/lib/qtermwidget/BlockArray.h @@ -29,8 +29,6 @@ #define QTERMWIDGET_BLOCKSIZE (1 << 12) #define ENTRIES (QTERMWIDGET_BLOCKSIZE - sizeof(size_t)) -namespace Konsole { - struct Block { unsigned char data[ENTRIES] = {}; size_t size = 0; @@ -120,6 +118,4 @@ class BlockArray { size_t length; }; -} - #endif diff --git a/lib/qtermwidget/Character.h b/lib/qtermwidget/Character.h index 9c9fae29..d657e22f 100644 --- a/lib/qtermwidget/Character.h +++ b/lib/qtermwidget/Character.h @@ -19,25 +19,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef CHARACTER_H #define CHARACTER_H -// Qt #include -// Local #include "CharacterColor.h" -namespace Konsole -{ - typedef unsigned char LineProperty; -static const int LINE_DEFAULT = 0; +static const int LINE_DEFAULT = 0; static const int LINE_WRAPPED = (1 << 0); static const int LINE_DOUBLEWIDTH = (1 << 1); -static const int LINE_DOUBLEHEIGHT = (1 << 2); +static const int LINE_DOUBLEHEIGHT = (1 << 2); #define DEFAULT_RENDITION 0 #define RE_BOLD (1 << 0) @@ -222,8 +216,7 @@ class ExtendedCharTable QHash extendedCharTable; }; -} -Q_DECLARE_TYPEINFO(Konsole::Character, Q_MOVABLE_TYPE); +Q_DECLARE_TYPEINFO(Character, Q_MOVABLE_TYPE); #endif // CHARACTER_H diff --git a/lib/qtermwidget/CharacterColor.h b/lib/qtermwidget/CharacterColor.h index bd1b02b6..eae90220 100644 --- a/lib/qtermwidget/CharacterColor.h +++ b/lib/qtermwidget/CharacterColor.h @@ -19,16 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef CHARACTERCOLOR_H #define CHARACTERCOLOR_H -// Qt #include -namespace Konsole -{ - /** * An entry in a terminal display's color palette. * @@ -300,8 +295,4 @@ inline void CharacterColor::setIntensive() } } - -} - #endif // CHARACTERCOLOR_H - diff --git a/lib/qtermwidget/ColorScheme.cpp b/lib/qtermwidget/ColorScheme.cpp index 92ebd9d0..dd61e487 100644 --- a/lib/qtermwidget/ColorScheme.cpp +++ b/lib/qtermwidget/ColorScheme.cpp @@ -18,12 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -// Own #include "ColorScheme.h" #include "tools.h" -// Qt #include #include #include @@ -34,8 +31,6 @@ #include #include -using namespace Konsole; - const ColorEntry ColorScheme::defaultTable[TABLE_COLORS] = // The following are almost IBM standard color codes, with some slight // gamma correction for the dim colors to compensate for bright X screens. diff --git a/lib/qtermwidget/ColorScheme.h b/lib/qtermwidget/ColorScheme.h index 09ec3b11..47591a88 100644 --- a/lib/qtermwidget/ColorScheme.h +++ b/lib/qtermwidget/ColorScheme.h @@ -18,11 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef COLORSCHEME_H #define COLORSCHEME_H -// Qt #include #include #include @@ -30,14 +28,9 @@ #include #include -// Konsole #include "CharacterColor.h" class QIODevice; -//class KConfig; - -namespace Konsole -{ /** * Represents a color scheme for a terminal display. @@ -310,8 +303,6 @@ class ColorSchemeManager static const ColorScheme _defaultColorScheme; }; -} - -Q_DECLARE_METATYPE(const Konsole::ColorScheme*) +Q_DECLARE_METATYPE(const ColorScheme*) #endif //COLORSCHEME_H diff --git a/lib/qtermwidget/ColorTables.h b/lib/qtermwidget/ColorTables.h index 7ea11fdd..1ff7583a 100644 --- a/lib/qtermwidget/ColorTables.h +++ b/lib/qtermwidget/ColorTables.h @@ -4,8 +4,6 @@ #include "CharacterColor.h" #if 0 -using namespace Konsole; - static const ColorEntry whiteonblack_color_table[TABLE_COLORS] = { // normal ColorEntry(QColor(0xFF,0xFF,0xFF), false ), ColorEntry( QColor(0x00,0x00,0x00), true ), // Dfore, Dback diff --git a/lib/qtermwidget/Emulation.cpp b/lib/qtermwidget/Emulation.cpp index 5da5c954..b8c30711 100644 --- a/lib/qtermwidget/Emulation.cpp +++ b/lib/qtermwidget/Emulation.cpp @@ -38,8 +38,6 @@ #include "TerminalCharacterDecoder.h" #include "ScreenWindow.h" -using namespace Konsole; - Emulation::Emulation() : _currentScreen(nullptr), _keyTranslator(nullptr), @@ -53,14 +51,14 @@ Emulation::Emulation() : _screen[1] = new Screen(40,80); _currentScreen = _screen[0]; - QObject::connect(&_bulkTimer1, &QTimer::timeout, this, &Konsole::Emulation::showBulk); - QObject::connect(&_bulkTimer2, &QTimer::timeout, this, &Konsole::Emulation::showBulk); + QObject::connect(&_bulkTimer1, &QTimer::timeout, this, &Emulation::showBulk); + QObject::connect(&_bulkTimer2, &QTimer::timeout, this, &Emulation::showBulk); // listen for mouse status changes - connect(this, &Konsole::Emulation::programUsesMouseChanged, - this, &Konsole::Emulation::usesMouseChanged); - connect(this, &Konsole::Emulation::programBracketedPasteModeChanged, - this, &Konsole::Emulation::bracketedPasteModeChanged); + connect(this, &Emulation::programUsesMouseChanged, + this, &Emulation::usesMouseChanged); + connect(this, &Emulation::programBracketedPasteModeChanged, + this, &Emulation::bracketedPasteModeChanged); connect(this, &Emulation::cursorChanged, this, [this] (KeyboardCursorShape cursorShape, bool blinkingCursorEnabled) { emit titleChanged( 50, QString(QLatin1String("CursorShape=%1;BlinkingCursorEnabled=%2")) @@ -94,11 +92,11 @@ ScreenWindow* Emulation::createWindow() window->setScreen(_currentScreen); _windows << window; - connect(window, &Konsole::ScreenWindow::selectionChanged, - this, &Konsole::Emulation::bufferedUpdate); + connect(window, &ScreenWindow::selectionChanged, + this, &Emulation::bufferedUpdate); - connect(this, &Konsole::Emulation::outputChanged, - window, &Konsole::ScreenWindow::notifyOutputChanged); + connect(this, &Emulation::outputChanged, + window, &ScreenWindow::notifyOutputChanged); connect(this, &Emulation::handleCommandFromKeyboard, window, &ScreenWindow::handleCommandFromKeyboard); @@ -516,5 +514,3 @@ ExtendedCharTable::~ExtendedCharTable() ExtendedCharTable ExtendedCharTable::instance; -//#include "Emulation.moc" - diff --git a/lib/qtermwidget/Emulation.h b/lib/qtermwidget/Emulation.h index 89065cbc..f70963fb 100644 --- a/lib/qtermwidget/Emulation.h +++ b/lib/qtermwidget/Emulation.h @@ -19,16 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef EMULATION_H #define EMULATION_H -// System #include -// Qt #include -//#include #include #include #include @@ -36,9 +32,6 @@ #include "KeyboardTranslator.h" -namespace Konsole -{ - class HistoryType; class Screen; class ScreenWindow; @@ -532,6 +525,4 @@ private slots: QByteArray dupCache; }; -} - #endif // ifndef EMULATION_H diff --git a/lib/qtermwidget/Filter.cpp b/lib/qtermwidget/Filter.cpp index 18159088..48aea2a8 100644 --- a/lib/qtermwidget/Filter.cpp +++ b/lib/qtermwidget/Filter.cpp @@ -17,13 +17,10 @@ 02110-1301 USA. */ -// Own #include "Filter.h" -// System #include -// Qt #include #include #include @@ -40,23 +37,16 @@ #include "CharWidth.h" #include "qtermwidget.h" -using namespace Konsole; - FilterChain::~FilterChain() { - QMutableListIterator iter(*this); - - while ( iter.hasNext() ) - { - Filter* filter = iter.next(); - iter.remove(); - delete filter; - } + while (!isEmpty()) + delete takeFirst(); } void FilterChain::addFilter(Filter* filter) { - append(filter); + if(!containsFilter(filter)) + append(filter); } void FilterChain::removeFilter(Filter* filter) { @@ -176,9 +166,7 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines decoder.end(); } -Filter::Filter() : -_linePositions(nullptr), -_buffer(nullptr) +Filter::Filter() : QObject(nullptr) { } @@ -187,6 +175,7 @@ Filter::~Filter() qDeleteAll(_hotspotList); _hotspotList.clear(); } + void Filter::reset() { qDeleteAll(_hotspotList); @@ -321,7 +310,7 @@ void Filter::HotSpot::setColor(const QColor& color) _color = color; } -RegExpFilter::RegExpFilter() +RegExpFilter::RegExpFilter() : Filter() { } @@ -529,7 +518,7 @@ const QRegularExpression UrlFilter::CompleteUrlRegExp(QLatin1Char('(')+ FilePathRegExp.pattern()+ QLatin1Char(')')); -UrlFilter::UrlFilter() +UrlFilter::UrlFilter() : RegExpFilter() { setRegExp( CompleteUrlRegExp ); } @@ -641,5 +630,3 @@ QList UrlFilter::HotSpot::actions() return list; } - -//#include "Filter.moc" diff --git a/lib/qtermwidget/Filter.h b/lib/qtermwidget/Filter.h index e0fc081f..2ad71f5d 100644 --- a/lib/qtermwidget/Filter.h +++ b/lib/qtermwidget/Filter.h @@ -20,7 +20,6 @@ #ifndef FILTER_H #define FILTER_H -// Qt #include #include #include @@ -29,11 +28,7 @@ #include #include -namespace Konsole -{ - -typedef unsigned char LineProperty; -class Character; +#include "Character.h" /** * A filter processes blocks of text looking for certain patterns (such as URLs or keywords from a list) @@ -55,6 +50,7 @@ class Character; */ class Filter : public QObject { + Q_OBJECT public: /** * Represents an area of text which matched the pattern a particular filter has been looking for. @@ -176,8 +172,8 @@ class Filter : public QObject QMultiHash _hotspots; QList _hotspotList; - const QList* _linePositions; - const QString* _buffer; + const QList* _linePositions = nullptr; + const QString* _buffer = nullptr; }; /** @@ -189,6 +185,7 @@ class Filter : public QObject */ class RegExpFilter : public Filter { + Q_OBJECT public: /** * Type of hotspot created by RegExpFilter. The capturedTexts() method can be used to find the text @@ -399,8 +396,4 @@ class TerminalImageFilterChain : public FilterChain QList* _linePositions; }; -} - -typedef Konsole::Filter Filter; - #endif //FILTER_H diff --git a/lib/qtermwidget/History.cpp b/lib/qtermwidget/History.cpp index 5b9803aa..3e15f4be 100644 --- a/lib/qtermwidget/History.cpp +++ b/lib/qtermwidget/History.cpp @@ -18,10 +18,8 @@ 02110-1301 USA. */ -// Own #include "History.h" -// System #include #include #include @@ -40,8 +38,6 @@ // Reasonable line size #define LINE_SIZE 1024 -using namespace Konsole; - /* An arbitrary long scroll. diff --git a/lib/qtermwidget/History.h b/lib/qtermwidget/History.h index 0f86601d..0a3cb7d2 100644 --- a/lib/qtermwidget/History.h +++ b/lib/qtermwidget/History.h @@ -21,7 +21,6 @@ #ifndef TEHISTORY_H #define TEHISTORY_H -// Qt #include #include #include @@ -37,9 +36,6 @@ #include #endif -namespace Konsole -{ - #if 1 /* An extendable tmpfile(1) based buffer. @@ -496,6 +492,4 @@ class CompactHistoryType : public HistoryType #endif -} - #endif // TEHISTORY_H diff --git a/lib/qtermwidget/HistorySearch.h b/lib/qtermwidget/HistorySearch.h index 9762db24..4a17484f 100644 --- a/lib/qtermwidget/HistorySearch.h +++ b/lib/qtermwidget/HistorySearch.h @@ -30,8 +30,6 @@ #include "Emulation.h" #include "TerminalCharacterDecoder.h" -using namespace Konsole; - typedef QPointer EmulationPtr; class HistorySearch : public QObject diff --git a/lib/qtermwidget/KeyboardTranslator.cpp b/lib/qtermwidget/KeyboardTranslator.cpp index 92c75bc5..ef76d4e5 100644 --- a/lib/qtermwidget/KeyboardTranslator.cpp +++ b/lib/qtermwidget/KeyboardTranslator.cpp @@ -18,15 +18,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -// Own #include "KeyboardTranslator.h" -// System #include #include -// Qt #include #include #include @@ -38,9 +34,6 @@ #include "tools.h" -using namespace Konsole; - - const QByteArray KeyboardTranslatorManager::defaultTranslatorText( "keyboard \"Fallback Key Translator\"\n" "key Tab : \"\\t\"" diff --git a/lib/qtermwidget/KeyboardTranslator.h b/lib/qtermwidget/KeyboardTranslator.h index 3cdc2381..7f650fbf 100644 --- a/lib/qtermwidget/KeyboardTranslator.h +++ b/lib/qtermwidget/KeyboardTranslator.h @@ -18,11 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef KEYBOARDTRANSLATOR_H #define KEYBOARDTRANSLATOR_H -// Qt #include #include #include @@ -32,9 +30,6 @@ class QIODevice; class QTextStream; -namespace Konsole -{ - /** * A convertor which maps between key sequences pressed by the user and the * character strings which should be sent to the terminal and commands @@ -587,10 +582,8 @@ inline void KeyboardTranslator::Entry::setStateMask( States stateMask ) } inline KeyboardTranslator::States KeyboardTranslator::Entry::stateMask() const { return _stateMask; } -} - -Q_DECLARE_METATYPE(Konsole::KeyboardTranslator::Entry) -Q_DECLARE_METATYPE(const Konsole::KeyboardTranslator*) +Q_DECLARE_METATYPE(KeyboardTranslator::Entry) +Q_DECLARE_METATYPE(const KeyboardTranslator*) #endif // KEYBOARDTRANSLATOR_H diff --git a/lib/qtermwidget/Screen.cpp b/lib/qtermwidget/Screen.cpp index b02d95c6..cf406feb 100644 --- a/lib/qtermwidget/Screen.cpp +++ b/lib/qtermwidget/Screen.cpp @@ -19,25 +19,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -// Own #include "Screen.h" -// Standard #include #include #include #include -// Qt #include #include #include "CharWidth.h" #include "TerminalCharacterDecoder.h" -using namespace Konsole; - //Macro to convert x,y position on screen to position within an image. // //Originally the image was stored as one large contiguous block of diff --git a/lib/qtermwidget/Screen.h b/lib/qtermwidget/Screen.h index ce355512..dd1499f0 100644 --- a/lib/qtermwidget/Screen.h +++ b/lib/qtermwidget/Screen.h @@ -38,9 +38,6 @@ #define MODE_NewLine 5 #define MODES_SCREEN 6 -namespace Konsole -{ - class TerminalCharacterDecoder; /** @@ -691,6 +688,4 @@ class Screen static Character defaultChar; }; -} - #endif // SCREEN_H diff --git a/lib/qtermwidget/ScreenWindow.cpp b/lib/qtermwidget/ScreenWindow.cpp index fc082076..e5d73c2e 100644 --- a/lib/qtermwidget/ScreenWindow.cpp +++ b/lib/qtermwidget/ScreenWindow.cpp @@ -21,8 +21,6 @@ #include #include "Screen.h" -using namespace Konsole; - ScreenWindow::ScreenWindow(QObject* parent) : QObject(parent) , _screen(nullptr) @@ -361,5 +359,3 @@ void ScreenWindow::handleCommandFromKeyboard(KeyboardTranslator::Command command Q_EMIT outputChanged(); } } - -//#include "ScreenWindow.moc" diff --git a/lib/qtermwidget/ScreenWindow.h b/lib/qtermwidget/ScreenWindow.h index 65a4aaea..0921a34d 100644 --- a/lib/qtermwidget/ScreenWindow.h +++ b/lib/qtermwidget/ScreenWindow.h @@ -27,9 +27,6 @@ #include "Character.h" #include "KeyboardTranslator.h" -namespace Konsole -{ - class Screen; /** @@ -268,5 +265,4 @@ public slots: // the last call to resetScrollCount() }; -} #endif // SCREENWINDOW_H diff --git a/lib/qtermwidget/Session.cpp b/lib/qtermwidget/Session.cpp index 990b2859..65951962 100644 --- a/lib/qtermwidget/Session.cpp +++ b/lib/qtermwidget/Session.cpp @@ -21,14 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -// Own #include "Session.h" -// Standard #include -// Qt #include #include #include @@ -40,8 +36,6 @@ #include "TerminalDisplay.h" #include "Vt102Emulation.h" -using namespace Konsole; - int Session::lastSessionId = 0; Session::Session(QObject* parent) : @@ -73,7 +67,7 @@ Session::Session(QObject* parent) : connect( _emulation, SIGNAL(profileChangeCommandReceived(const QString &)), this, SIGNAL( profileChangeCommandReceived(const QString &)) ); - connect(_emulation, &Konsole::Emulation::primaryScreenInUse, + connect(_emulation, &Emulation::primaryScreenInUse, this, &Session::onPrimaryScreenInUse); connect(_emulation, SIGNAL(imageResizeRequest(QSize)), this, SLOT(onEmulationSizeChange(QSize))); diff --git a/lib/qtermwidget/Session.h b/lib/qtermwidget/Session.h index 5ef4f7b8..da8ed512 100644 --- a/lib/qtermwidget/Session.h +++ b/lib/qtermwidget/Session.h @@ -31,8 +31,6 @@ #include "Emulation.h" #include "History.h" -namespace Konsole { - class Emulation; class TerminalDisplay; @@ -551,6 +549,4 @@ class SessionGroup : public QObject { int _masterMode; }; -} - #endif diff --git a/lib/qtermwidget/TerminalCharacterDecoder.cpp b/lib/qtermwidget/TerminalCharacterDecoder.cpp index 9eb4cf59..d067622c 100644 --- a/lib/qtermwidget/TerminalCharacterDecoder.cpp +++ b/lib/qtermwidget/TerminalCharacterDecoder.cpp @@ -24,7 +24,6 @@ #include "CharWidth.h" #include -using namespace Konsole; PlainTextDecoder::PlainTextDecoder() : _output(nullptr) , _includeTrailingWhitespace(true) diff --git a/lib/qtermwidget/TerminalCharacterDecoder.h b/lib/qtermwidget/TerminalCharacterDecoder.h index 0f732ba3..e25e996e 100644 --- a/lib/qtermwidget/TerminalCharacterDecoder.h +++ b/lib/qtermwidget/TerminalCharacterDecoder.h @@ -28,9 +28,6 @@ class QTextStream; -namespace Konsole -{ - /** * Base class for terminal character decoders * @@ -144,6 +141,4 @@ class HTMLDecoder : public TerminalCharacterDecoder CharacterColor _lastBackColor; }; -} - #endif diff --git a/lib/qtermwidget/TerminalDisplay.cpp b/lib/qtermwidget/TerminalDisplay.cpp index 7f79f5bd..15312371 100644 --- a/lib/qtermwidget/TerminalDisplay.cpp +++ b/lib/qtermwidget/TerminalDisplay.cpp @@ -19,11 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - -// Own #include "TerminalDisplay.h" -// Qt #include #include #include @@ -56,8 +53,6 @@ #include "ScreenWindow.h" #include "TerminalCharacterDecoder.h" -using namespace Konsole; - #ifndef loc #define loc(X,Y) ((Y)*_columns+(X)) #endif @@ -68,7 +63,7 @@ using namespace Konsole; "abcdefgjijklmnopqrstuvwxyz" \ "0123456789./+@" -const ColorEntry Konsole::base_color_table[TABLE_COLORS] = +const ColorEntry base_color_table[TABLE_COLORS] = // The following are almost IBM standard color codes, with some slight // gamma correction for the dim colors to compensate for bright X screens. // It contains the 8 ansiterm/xterm colors in 2 intensities. @@ -206,7 +201,7 @@ bool TerminalDisplay::isLineCharString(const std::wstring& string) const { // assert for i in [0..31] : vt100extended(vt100_graphics[i]) == i. -unsigned short Konsole::vt100_graphics[32] = +unsigned short vt100_graphics[32] = { // 0/8 1/9 2/10 3/11 4/12 5/13 6/14 7/15 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, @@ -3724,6 +3719,3 @@ bool AutoScrollHandler::eventFilter(QObject* watched,QEvent* event) return false; } - - -//#include "TerminalDisplay.moc" diff --git a/lib/qtermwidget/TerminalDisplay.h b/lib/qtermwidget/TerminalDisplay.h index 24591b6c..07894c9c 100644 --- a/lib/qtermwidget/TerminalDisplay.h +++ b/lib/qtermwidget/TerminalDisplay.h @@ -56,29 +56,24 @@ class QHideEvent; class QTimerEvent; class QWidget; -//class KMenu; - -namespace Konsole +enum MotionAfterPasting { + // No move screenwindow after pasting + NoMoveScreenWindow = 0, + // Move start of screenwindow after pasting + MoveStartScreenWindow = 1, + // Move end of screenwindow after pasting + MoveEndScreenWindow = 2 +}; - enum MotionAfterPasting - { - // No move screenwindow after pasting - NoMoveScreenWindow = 0, - // Move start of screenwindow after pasting - MoveStartScreenWindow = 1, - // Move end of screenwindow after pasting - MoveEndScreenWindow = 2 - }; - - enum BackgroundMode { - None, - Stretch, - Zoom, - Fit, - Center, - Tile - }; +enum BackgroundMode { + None, + Stretch, + Zoom, + Fit, + Center, + Tile +}; extern unsigned short vt100_graphics[32]; @@ -1012,6 +1007,4 @@ class MultilineConfirmationMessageBox : public QDialog { QDialogButtonBox *buttonBox; }; -} - #endif // TERMINALDISPLAY_H diff --git a/lib/qtermwidget/Vt102Emulation.cpp b/lib/qtermwidget/Vt102Emulation.cpp index 3f6901bf..1452a207 100644 --- a/lib/qtermwidget/Vt102Emulation.cpp +++ b/lib/qtermwidget/Vt102Emulation.cpp @@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #include "Vt102Emulation.h" #include "tools.h" #include @@ -34,9 +33,6 @@ #include "KeyboardTranslator.h" #include "Screen.h" - -using namespace Konsole; - Vt102Emulation::Vt102Emulation() : Emulation(), prevCC(0), @@ -46,7 +42,7 @@ Vt102Emulation::Vt102Emulation() { _titleUpdateTimer->setSingleShot(true); QObject::connect(_titleUpdateTimer, &QTimer::timeout, - this, &Konsole::Vt102Emulation::updateTitle); + this, &Vt102Emulation::updateTitle); initTokenizer(); reset(); @@ -1430,5 +1426,3 @@ void Vt102Emulation::reportDecodingError() qCDebug(qtermwidgetLogger) << "Undecodable sequence:" << QString::fromWCharArray(tokenBuffer, tokenBufferPos); } -//#include "Vt102Emulation.moc" - diff --git a/lib/qtermwidget/Vt102Emulation.h b/lib/qtermwidget/Vt102Emulation.h index 2fa28d80..4966a79d 100644 --- a/lib/qtermwidget/Vt102Emulation.h +++ b/lib/qtermwidget/Vt102Emulation.h @@ -48,9 +48,6 @@ #define MODE_BracketedPaste (MODES_SCREEN+13) // Xterm-style bracketed paste mode #define MODE_total (MODES_SCREEN+14) -namespace Konsole -{ - struct CharCodes { // coding info @@ -195,6 +192,4 @@ private slots: QStringEncoder _toUtf8; }; -} - #endif // VT102EMULATION_H diff --git a/lib/qtermwidget/qtermwidget.cpp b/lib/qtermwidget/qtermwidget.cpp index c5f5a753..bbce1c7e 100644 --- a/lib/qtermwidget/qtermwidget.cpp +++ b/lib/qtermwidget/qtermwidget.cpp @@ -15,7 +15,6 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include #include #include @@ -43,60 +42,6 @@ #define STEP_ZOOM 3 -using namespace Konsole; - -class TermWidgetImpl { -public: - TermWidgetImpl(QWidget* parent = nullptr); - - TerminalDisplay *m_terminalDisplay; - Session *m_session; - - Session* createSession(QWidget* parent); - TerminalDisplay* createTerminalDisplay(Session *session, QWidget* parent); -}; - -TermWidgetImpl::TermWidgetImpl(QWidget* parent) -{ - this->m_session = createSession(parent); - this->m_terminalDisplay = createTerminalDisplay(this->m_session, parent); -} - - -Session *TermWidgetImpl::createSession(QWidget* parent) -{ - Session *session = new Session(parent); - - session->setTitle(Session::NameRole, QLatin1String("QTermWidget")); - - QStringList args = QStringList(QString()); - - session->setCodec(QStringEncoder{QStringConverter::Encoding::Utf8}); - - session->setFlowControlEnabled(true); - session->setHistoryType(HistoryTypeBuffer(1000)); - - session->setDarkBackground(true); - - session->setKeyBindings(QString()); - return session; -} - -TerminalDisplay *TermWidgetImpl::createTerminalDisplay(Session *session, QWidget* parent) -{ -// TerminalDisplay* display = new TerminalDisplay(this); - TerminalDisplay* display = new TerminalDisplay(parent); - - display->setBellMode(TerminalDisplay::NotifyBell); - display->setTerminalSizeHint(true); - display->setTripleClickMode(TerminalDisplay::SelectWholeLine); - display->setTerminalSizeStartup(true); - - display->setRandomSeed(session->sessionId() * 31); - - return display; -} - QTermWidget::QTermWidget(QWidget *messageParentWidget, QWidget *parent) : QWidget(parent) { @@ -104,27 +49,41 @@ QTermWidget::QTermWidget(QWidget *messageParentWidget, QWidget *parent) m_layout->setContentsMargins(0, 0, 0, 0); setLayout(m_layout); - m_impl = new TermWidgetImpl(this); - m_layout->addWidget(m_impl->m_terminalDisplay); - m_impl->m_terminalDisplay->setObjectName("terminalDisplay"); + m_session = new Session(this); + m_session->setTitle(Session::NameRole, QLatin1String("QTermWidget")); + m_session->setCodec(QStringEncoder{QStringConverter::Encoding::Utf8}); + m_session->setFlowControlEnabled(true); + m_session->setHistoryType(HistoryTypeBuffer(1000)); + m_session->setDarkBackground(true); + m_session->setKeyBindings(QString()); + + m_terminalDisplay = new TerminalDisplay(this); + m_terminalDisplay->setBellMode(TerminalDisplay::NotifyBell); + m_terminalDisplay->setTerminalSizeHint(true); + m_terminalDisplay->setTripleClickMode(TerminalDisplay::SelectWholeLine); + m_terminalDisplay->setTerminalSizeStartup(true); + m_terminalDisplay->setRandomSeed(m_session->sessionId() * 31); + + m_layout->addWidget(m_terminalDisplay); + m_terminalDisplay->setObjectName("terminalDisplay"); setMessageParentWidget(messageParentWidget?messageParentWidget:this); - connect(m_impl->m_session, SIGNAL(bellRequest(QString)), m_impl->m_terminalDisplay, SLOT(bell(QString))); - connect(m_impl->m_terminalDisplay, SIGNAL(notifyBell(QString)), this, SIGNAL(bell(QString))); - connect(m_impl->m_terminalDisplay, SIGNAL(handleCtrlC()), this, SIGNAL(handleCtrlC())); - connect(m_impl->m_terminalDisplay, SIGNAL(changedContentCountSignal(int,int)),this, SLOT(sizeChange(int,int))); - connect(m_impl->m_terminalDisplay, SIGNAL(mousePressEventForwarded(QMouseEvent*)), this, SIGNAL(mousePressEventForwarded(QMouseEvent*))); - connect(m_impl->m_session, SIGNAL(activity()), this, SIGNAL(activity())); - connect(m_impl->m_session, SIGNAL(silence()), this, SIGNAL(silence())); - connect(m_impl->m_session, &Session::profileChangeCommandReceived, this, &QTermWidget::profileChanged); - connect(m_impl->m_session, &Session::receivedData, this, &QTermWidget::receivedData); - connect(m_impl->m_session->emulation(), SIGNAL(zmodemRecvDetected()), this, SIGNAL(zmodemRecvDetected()) ); - connect(m_impl->m_session->emulation(), SIGNAL(zmodemSendDetected()), this, SIGNAL(zmodemSendDetected()) ); + connect(m_session, SIGNAL(bellRequest(QString)), m_terminalDisplay, SLOT(bell(QString))); + connect(m_terminalDisplay, SIGNAL(notifyBell(QString)), this, SIGNAL(bell(QString))); + connect(m_terminalDisplay, SIGNAL(handleCtrlC()), this, SIGNAL(handleCtrlC())); + connect(m_terminalDisplay, SIGNAL(changedContentCountSignal(int,int)),this, SLOT(sizeChange(int,int))); + connect(m_terminalDisplay, SIGNAL(mousePressEventForwarded(QMouseEvent*)), this, SIGNAL(mousePressEventForwarded(QMouseEvent*))); + connect(m_session, SIGNAL(activity()), this, SIGNAL(activity())); + connect(m_session, SIGNAL(silence()), this, SIGNAL(silence())); + connect(m_session, &Session::profileChangeCommandReceived, this, &QTermWidget::profileChanged); + connect(m_session, &Session::receivedData, this, &QTermWidget::receivedData); + connect(m_session->emulation(), SIGNAL(zmodemRecvDetected()), this, SIGNAL(zmodemRecvDetected()) ); + connect(m_session->emulation(), SIGNAL(zmodemSendDetected()), this, SIGNAL(zmodemSendDetected()) ); // That's OK, FilterChain's dtor takes care of UrlFilter. urlFilter = new UrlFilter(); connect(urlFilter, &UrlFilter::activated, this, &QTermWidget::urlActivated); - m_impl->m_terminalDisplay->filterChain()->addFilter(urlFilter); + m_terminalDisplay->filterChain()->addFilter(urlFilter); m_UrlFilterEnable = true; m_searchBar = new SearchBar(this); @@ -139,18 +98,17 @@ QTermWidget::QTermWidget(QWidget *messageParentWidget, QWidget *parent) this->setFocus( Qt::OtherFocusReason ); this->setFocusPolicy( Qt::WheelFocus ); - m_impl->m_terminalDisplay->resize(this->size()); + m_terminalDisplay->resize(this->size()); - this->setFocusProxy(m_impl->m_terminalDisplay); - connect(m_impl->m_terminalDisplay, SIGNAL(copyAvailable(bool)), + this->setFocusProxy(m_terminalDisplay); + connect(m_terminalDisplay, SIGNAL(copyAvailable(bool)), this, SLOT(selectionChanged(bool))); - connect(m_impl->m_terminalDisplay, SIGNAL(termGetFocus()), + connect(m_terminalDisplay, SIGNAL(termGetFocus()), this, SIGNAL(termGetFocus())); - connect(m_impl->m_terminalDisplay, SIGNAL(termLostFocus()), + connect(m_terminalDisplay, SIGNAL(termLostFocus()), this, SIGNAL(termLostFocus())); - connect(m_impl->m_terminalDisplay, &TerminalDisplay::keyPressedSignal, this, + connect(m_terminalDisplay, &TerminalDisplay::keyPressedSignal, this, [this] (QKeyEvent* e, bool) { Q_EMIT termKeyPressed(e); }); -// m_impl->m_terminalDisplay->setSize(80, 40); QFont font = QApplication::font(); font.setFamily(QLatin1String(DEFAULT_FONT_FAMILY)); @@ -162,12 +120,20 @@ QTermWidget::QTermWidget(QWidget *messageParentWidget, QWidget *parent) setScrollBarPosition(NoScrollBar); setKeyboardCursorShape(Emulation::KeyboardCursorShape::BlockCursor); - m_impl->m_session->addView(m_impl->m_terminalDisplay); + m_session->addView(m_terminalDisplay); - connect(m_impl->m_session, SIGNAL(resizeRequest(QSize)), this, SLOT(setSize(QSize))); - connect(m_impl->m_session, SIGNAL(finished()), this, SLOT(sessionFinished())); - connect(m_impl->m_session, &Session::titleChanged, this, &QTermWidget::titleChanged); - connect(m_impl->m_session, &Session::cursorChanged, this, &QTermWidget::cursorChanged); + connect(m_session, SIGNAL(resizeRequest(QSize)), this, SLOT(setSize(QSize))); + connect(m_session, SIGNAL(finished()), this, SLOT(sessionFinished())); + connect(m_session, &Session::titleChanged, this, &QTermWidget::titleChanged); + connect(m_session, &Session::cursorChanged, this, &QTermWidget::cursorChanged); +} + +QTermWidget::~QTermWidget() +{ + setUrlFilterEnabled(true); + clearHighLightTexts(); + delete m_searchBar; + emit destroyed(); } void QTermWidget::selectionChanged(bool textSelected) @@ -196,16 +162,16 @@ void QTermWidget::search(bool forwards, bool next) if (next) // search from just after current selection { - m_impl->m_terminalDisplay->screenWindow()->screen()->getSelectionEnd(startColumn, startLine); + m_terminalDisplay->screenWindow()->screen()->getSelectionEnd(startColumn, startLine); startColumn++; } else // search from start of current selection { - m_impl->m_terminalDisplay->screenWindow()->screen()->getSelectionStart(startColumn, startLine); + m_terminalDisplay->screenWindow()->screen()->getSelectionStart(startColumn, startLine); } //qDebug() << "current selection starts at: " << startColumn << startLine; - //qDebug() << "current cursor position: " << m_impl->m_terminalDisplay->screenWindow()->cursorPosition(); + //qDebug() << "current cursor position: " << m_terminalDisplay->screenWindow()->cursorPosition(); QRegularExpression regExp; if (m_searchBar->useRegularExpression()) { @@ -216,7 +182,7 @@ void QTermWidget::search(bool forwards, bool next) regExp.setPatternOptions(m_searchBar->matchCase() ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption); HistorySearch *historySearch = - new HistorySearch(m_impl->m_session->emulation(), regExp, forwards, startColumn, startLine, this); + new HistorySearch(m_session->emulation(), regExp, forwards, startColumn, startLine, this); connect(historySearch, SIGNAL(matchFound(int, int, int, int)), this, SLOT(matchFound(int, int, int, int))); connect(historySearch, SIGNAL(noMatchFound()), this, SLOT(noMatchFound())); connect(historySearch, SIGNAL(noMatchFound()), m_searchBar, SLOT(noMatchFound())); @@ -226,7 +192,7 @@ void QTermWidget::search(bool forwards, bool next) void QTermWidget::matchFound(int startColumn, int startLine, int endColumn, int endLine) { - ScreenWindow* sw = m_impl->m_terminalDisplay->screenWindow(); + ScreenWindow* sw = m_terminalDisplay->screenWindow(); //qDebug() << "Scroll to" << startLine; sw->scrollTo(startLine); sw->setTrackOutput(false); @@ -237,89 +203,79 @@ void QTermWidget::matchFound(int startColumn, int startLine, int endColumn, int void QTermWidget::noMatchFound() { - m_impl->m_terminalDisplay->screenWindow()->clearSelection(); + m_terminalDisplay->screenWindow()->clearSelection(); } QSize QTermWidget::sizeHint() const { - QSize size = m_impl->m_terminalDisplay->sizeHint(); + QSize size = m_terminalDisplay->sizeHint(); size.rheight() = 150; return size; } void QTermWidget::setTerminalSizeHint(bool enabled) { - m_impl->m_terminalDisplay->setTerminalSizeHint(enabled); + m_terminalDisplay->setTerminalSizeHint(enabled); } bool QTermWidget::terminalSizeHint() { - return m_impl->m_terminalDisplay->terminalSizeHint(); + return m_terminalDisplay->terminalSizeHint(); } void QTermWidget::startTerminalTeletype() { - m_impl->m_session->runEmptyPTY(); + m_session->runEmptyPTY(); // redirect data from TTY to external recipient - connect( m_impl->m_session->emulation(), &Emulation::sendData, this, [this](const char *buff, int len) { + connect( m_session->emulation(), &Emulation::sendData, this, [this](const char *buff, int len) { if (m_echo) { recvData(buff, len); } emit sendData(buff, len); }); - connect( m_impl->m_session->emulation(), &Emulation::dupDisplayOutput, this, &QTermWidget::dupDisplayOutput); + connect( m_session->emulation(), &Emulation::dupDisplayOutput, this, &QTermWidget::dupDisplayOutput); } -QTermWidget::~QTermWidget() -{ - setUrlFilterEnabled(true); - clearHighLightTexts(); - delete m_searchBar; - delete m_impl; - emit destroyed(); -} - - void QTermWidget::setTerminalFont(const QFont &font) { - m_impl->m_terminalDisplay->setVTFont(font); + m_terminalDisplay->setVTFont(font); } QFont QTermWidget::getTerminalFont() { - return m_impl->m_terminalDisplay->getVTFont(); + return m_terminalDisplay->getVTFont(); } void QTermWidget::setTerminalOpacity(qreal level) { - m_impl->m_terminalDisplay->setOpacity(level); + m_terminalDisplay->setOpacity(level); } void QTermWidget::setTerminalBackgroundImage(const QString& backgroundImage) { - m_impl->m_terminalDisplay->setBackgroundImage(backgroundImage); + m_terminalDisplay->setBackgroundImage(backgroundImage); } void QTermWidget::setTerminalBackgroundMovie(const QString& backgroundMovie) { - m_impl->m_terminalDisplay->setBackgroundMovie(backgroundMovie); + m_terminalDisplay->setBackgroundMovie(backgroundMovie); } void QTermWidget::setTerminalBackgroundVideo(const QString& backgroundVideo) { - m_impl->m_terminalDisplay->setBackgroundVideo(backgroundVideo); + m_terminalDisplay->setBackgroundVideo(backgroundVideo); } void QTermWidget::setTerminalBackgroundMode(int mode) { - m_impl->m_terminalDisplay->setBackgroundMode((Konsole::BackgroundMode)mode); + m_terminalDisplay->setBackgroundMode((BackgroundMode)mode); } void QTermWidget::setTextCodec(QStringEncoder codec) { - if (!m_impl->m_session) + if (!m_session) return; - m_impl->m_session->setCodec(std::move(codec)); + m_session->setCodec(std::move(codec)); } void QTermWidget::setColorScheme(const QString& origName) @@ -359,8 +315,8 @@ void QTermWidget::setColorScheme(const QString& origName) } ColorEntry table[TABLE_COLORS]; cs->getColorTable(table); - m_impl->m_terminalDisplay->setColorTable(table); - m_impl->m_session->setDarkBackground(cs->hasDarkBackground()); + m_terminalDisplay->setColorTable(table); + m_session->setDarkBackground(cs->hasDarkBackground()); } QStringList QTermWidget::getAvailableColorSchemes() @@ -384,42 +340,42 @@ void QTermWidget::addCustomColorSchemeDir(const QString& custom_dir) void QTermWidget::setBackgroundColor(const QColor &color) { - m_impl->m_terminalDisplay->setBackgroundColor(color); + m_terminalDisplay->setBackgroundColor(color); } void QTermWidget::setForegroundColor(const QColor &color) { - m_impl->m_terminalDisplay->setForegroundColor(color); + m_terminalDisplay->setForegroundColor(color); } void QTermWidget::setANSIColor(const int ansiColorId, const QColor &color) { - m_impl->m_terminalDisplay->setColorTableColor(ansiColorId, color); + m_terminalDisplay->setColorTableColor(ansiColorId, color); } void QTermWidget::setPreeditColorIndex(int index) { - m_impl->m_terminalDisplay->setPreeditColorIndex(index); + m_terminalDisplay->setPreeditColorIndex(index); } void QTermWidget::setSize(const QSize &size) { - m_impl->m_terminalDisplay->setSize(size.width(), size.height()); + m_terminalDisplay->setSize(size.width(), size.height()); } void QTermWidget::setHistorySize(int lines) { if (lines < 0) - m_impl->m_session->setHistoryType(HistoryTypeFile()); + m_session->setHistoryType(HistoryTypeFile()); else if (lines == 0) - m_impl->m_session->setHistoryType(HistoryTypeNone()); + m_session->setHistoryType(HistoryTypeNone()); else - m_impl->m_session->setHistoryType(HistoryTypeBuffer(lines)); + m_session->setHistoryType(HistoryTypeBuffer(lines)); } int QTermWidget::historySize() const { - const HistoryType& currentHistory = m_impl->m_session->historyType(); + const HistoryType& currentHistory = m_session->historyType(); if (currentHistory.isEnabled()) { if (currentHistory.isUnlimited()) { @@ -434,31 +390,30 @@ int QTermWidget::historySize() const void QTermWidget::setScrollBarPosition(ScrollBarPosition pos) { - m_impl->m_terminalDisplay->setScrollBarPosition(pos); + m_terminalDisplay->setScrollBarPosition(pos); } void QTermWidget::scrollToEnd() { - m_impl->m_terminalDisplay->scrollToEnd(); + m_terminalDisplay->scrollToEnd(); } void QTermWidget::sendText(const QString &text) { - m_impl->m_session->sendText(text); + m_session->sendText(text); } void QTermWidget::sendKeyEvent(QKeyEvent *e) { - m_impl->m_session->sendKeyEvent(e); + m_session->sendKeyEvent(e); } void QTermWidget::resizeEvent(QResizeEvent*) { -//qDebug("global window resizing...with %d %d", this->size().width(), this->size().height()); - m_impl->m_terminalDisplay->resize(this->size()); + //qDebug("global window resizing...with %d %d", this->size().width(), this->size().height()); + m_terminalDisplay->resize(this->size()); } - void QTermWidget::sessionFinished() { emit finished(); @@ -466,47 +421,47 @@ void QTermWidget::sessionFinished() void QTermWidget::bracketText(QString& text) { - m_impl->m_terminalDisplay->bracketText(text); + m_terminalDisplay->bracketText(text); } void QTermWidget::disableBracketedPasteMode(bool disable) { - m_impl->m_terminalDisplay->disableBracketedPasteMode(disable); + m_terminalDisplay->disableBracketedPasteMode(disable); } bool QTermWidget::bracketedPasteModeIsDisabled() const { - return m_impl->m_terminalDisplay->bracketedPasteModeIsDisabled(); + return m_terminalDisplay->bracketedPasteModeIsDisabled(); } void QTermWidget::copyClipboard() { - m_impl->m_terminalDisplay->copyClipboard(QClipboard::Clipboard); + m_terminalDisplay->copyClipboard(QClipboard::Clipboard); } void QTermWidget::copySelection() { - m_impl->m_terminalDisplay->copyClipboard(QClipboard::Selection); + m_terminalDisplay->copyClipboard(QClipboard::Selection); } void QTermWidget::pasteClipboard() { - m_impl->m_terminalDisplay->pasteClipboard(); + m_terminalDisplay->pasteClipboard(); } void QTermWidget::pasteSelection() { - m_impl->m_terminalDisplay->pasteSelection(); + m_terminalDisplay->pasteSelection(); } void QTermWidget::selectAll() { - m_impl->m_terminalDisplay->selectAll(); + m_terminalDisplay->selectAll(); } int QTermWidget::setZoom(int step) { - QFont font = m_impl->m_terminalDisplay->getVTFont(); + QFont font = m_terminalDisplay->getVTFont(); font.setPointSize(font.pointSize() + step); setTerminalFont(font); @@ -525,7 +480,7 @@ int QTermWidget::zoomOut() void QTermWidget::setKeyBindings(const QString & kb) { - m_impl->m_session->setKeyBindings(kb); + m_session->setKeyBindings(kb); } void QTermWidget::clear() @@ -536,18 +491,18 @@ void QTermWidget::clear() void QTermWidget::clearScrollback() { - m_impl->m_session->clearHistory(); + m_session->clearHistory(); } void QTermWidget::clearScreen() { - m_impl->m_session->emulation()->reset(); - m_impl->m_session->refresh(); + m_session->emulation()->reset(); + m_session->refresh(); } void QTermWidget::setFlowControlEnabled(bool enabled) { - m_impl->m_session->setFlowControlEnabled(enabled); + m_session->setFlowControlEnabled(enabled); } QStringList QTermWidget::availableKeyBindings() @@ -557,7 +512,7 @@ QStringList QTermWidget::availableKeyBindings() QString QTermWidget::keyBindings() { - return m_impl->m_session->keyBindings(); + return m_session->keyBindings(); } void QTermWidget::toggleShowSearchBar() @@ -572,146 +527,146 @@ void QTermWidget::toggleShowSearchBar() bool QTermWidget::flowControlEnabled(void) { - return m_impl->m_session->flowControlEnabled(); + return m_session->flowControlEnabled(); } void QTermWidget::setFlowControlWarningEnabled(bool enabled) { if (flowControlEnabled()) { // Do not show warning label if flow control is disabled - m_impl->m_terminalDisplay->setFlowControlWarningEnabled(enabled); + m_terminalDisplay->setFlowControlWarningEnabled(enabled); } } void QTermWidget::setMotionAfterPasting(int action) { - m_impl->m_terminalDisplay->setMotionAfterPasting((Konsole::MotionAfterPasting) action); + m_terminalDisplay->setMotionAfterPasting((MotionAfterPasting) action); } int QTermWidget::historyLinesCount() { - return m_impl->m_terminalDisplay->screenWindow()->screen()->getHistLines(); + return m_terminalDisplay->screenWindow()->screen()->getHistLines(); } int QTermWidget::screenColumnsCount() { - return m_impl->m_terminalDisplay->screenWindow()->screen()->getColumns(); + return m_terminalDisplay->screenWindow()->screen()->getColumns(); } int QTermWidget::screenLinesCount() { - return m_impl->m_terminalDisplay->screenWindow()->screen()->getLines(); + return m_terminalDisplay->screenWindow()->screen()->getLines(); } void QTermWidget::setSelectionStart(int row, int column) { - m_impl->m_terminalDisplay->screenWindow()->screen()->setSelectionStart(column, row, true); + m_terminalDisplay->screenWindow()->screen()->setSelectionStart(column, row, true); } void QTermWidget::setSelectionEnd(int row, int column) { - m_impl->m_terminalDisplay->screenWindow()->screen()->setSelectionEnd(column, row); + m_terminalDisplay->screenWindow()->screen()->setSelectionEnd(column, row); } void QTermWidget::getSelectionStart(int& row, int& column) { - m_impl->m_terminalDisplay->screenWindow()->screen()->getSelectionStart(column, row); + m_terminalDisplay->screenWindow()->screen()->getSelectionStart(column, row); } void QTermWidget::getSelectionEnd(int& row, int& column) { - m_impl->m_terminalDisplay->screenWindow()->screen()->getSelectionEnd(column, row); + m_terminalDisplay->screenWindow()->screen()->getSelectionEnd(column, row); } QString QTermWidget::selectedText(bool preserveLineBreaks) { - return m_impl->m_terminalDisplay->screenWindow()->screen()->selectedText(preserveLineBreaks); + return m_terminalDisplay->screenWindow()->screen()->selectedText(preserveLineBreaks); } void QTermWidget::setMonitorActivity(bool enabled) { - m_impl->m_session->setMonitorActivity(enabled); + m_session->setMonitorActivity(enabled); } void QTermWidget::setMonitorSilence(bool enabled) { - m_impl->m_session->setMonitorSilence(enabled); + m_session->setMonitorSilence(enabled); } void QTermWidget::setSilenceTimeout(int seconds) { - m_impl->m_session->setMonitorSilenceSeconds(seconds); + m_session->setMonitorSilenceSeconds(seconds); } Filter::HotSpot* QTermWidget::getHotSpotAt(const QPoint &pos) const { int row = 0, column = 0; - m_impl->m_terminalDisplay->getCharacterPosition(pos, row, column); + m_terminalDisplay->getCharacterPosition(pos, row, column); return getHotSpotAt(row, column); } Filter::HotSpot* QTermWidget::getHotSpotAt(int row, int column) const { - return m_impl->m_terminalDisplay->filterChain()->hotSpotAt(row, column); + return m_terminalDisplay->filterChain()->hotSpotAt(row, column); } QList QTermWidget::filterActions(const QPoint& position) { - return m_impl->m_terminalDisplay->filterActions(position); + return m_terminalDisplay->filterActions(position); } int QTermWidget::recvData(const char *buff, int len) const { - return m_impl->m_session->recvData(buff,len); + return m_session->recvData(buff,len); } void QTermWidget::setKeyboardCursorShape(KeyboardCursorShape shape) { - m_impl->m_terminalDisplay->setKeyboardCursorShape(shape); + m_terminalDisplay->setKeyboardCursorShape(shape); } void QTermWidget::setKeyboardCursorShape(uint32_t shape) { - m_impl->m_terminalDisplay->setKeyboardCursorShape((KeyboardCursorShape)shape); + m_terminalDisplay->setKeyboardCursorShape((KeyboardCursorShape)shape); } void QTermWidget::setBlinkingCursor(bool blink) { - m_impl->m_terminalDisplay->setBlinkingCursor(blink); + m_terminalDisplay->setBlinkingCursor(blink); } void QTermWidget::setBidiEnabled(bool enabled) { - m_impl->m_terminalDisplay->setBidiEnabled(enabled); + m_terminalDisplay->setBidiEnabled(enabled); } bool QTermWidget::isBidiEnabled() { - return m_impl->m_terminalDisplay->isBidiEnabled(); + return m_terminalDisplay->isBidiEnabled(); } QString QTermWidget::title() const { - QString title = m_impl->m_session->userTitle(); + QString title = m_session->userTitle(); if (title.isEmpty()) - title = m_impl->m_session->title(Konsole::Session::NameRole); + title = m_session->title(Session::NameRole); return title; } QString QTermWidget::icon() const { - QString icon = m_impl->m_session->iconText(); + QString icon = m_session->iconText(); if (icon.isEmpty()) - icon = m_impl->m_session->iconName(); + icon = m_session->iconName(); return icon; } bool QTermWidget::isTitleChanged() const { - return m_impl->m_session->isTitleChanged(); + return m_session->isTitleChanged(); } -void QTermWidget::cursorChanged(Konsole::Emulation::KeyboardCursorShape cursorShape, bool blinkingCursorEnabled) +void QTermWidget::cursorChanged(Emulation::KeyboardCursorShape cursorShape, bool blinkingCursorEnabled) { // TODO: A switch to enable/disable DECSCUSR? setKeyboardCursorShape(cursorShape); @@ -720,12 +675,12 @@ void QTermWidget::cursorChanged(Konsole::Emulation::KeyboardCursorShape cursorSh void QTermWidget::setMargin(int margin) { - m_impl->m_terminalDisplay->setMargin(margin); + m_terminalDisplay->setMargin(margin); } int QTermWidget::getMargin() const { - return m_impl->m_terminalDisplay->margin(); + return m_terminalDisplay->margin(); } void QTermWidget::saveHistory(QTextStream *stream, int format, int start, int end) @@ -741,9 +696,9 @@ void QTermWidget::saveHistory(QTextStream *stream, int format, int start, int en start = 0; } if(end < 0) { - end = m_impl->m_session->emulation()->lineCount(); + end = m_session->emulation()->lineCount(); } - m_impl->m_session->emulation()->writeToStream(decoder, start, end); + m_session->emulation()->writeToStream(decoder, start, end); delete decoder; } @@ -755,48 +710,48 @@ void QTermWidget::saveHistory(QIODevice *device, int format, int start, int end) void QTermWidget::screenShot(QPixmap *pixmap) { - QPixmap currPixmap(m_impl->m_terminalDisplay->size()); - m_impl->m_terminalDisplay->render(&currPixmap); + QPixmap currPixmap(m_terminalDisplay->size()); + m_terminalDisplay->render(&currPixmap); *pixmap = currPixmap.scaled(pixmap->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation); } void QTermWidget::repaintDisplay(void) { - m_impl->m_terminalDisplay->repaintDisplay(); + m_terminalDisplay->repaintDisplay(); } void QTermWidget::screenShot(const QString &fileName) { - qreal deviceratio = m_impl->m_terminalDisplay->devicePixelRatio(); + qreal deviceratio = m_terminalDisplay->devicePixelRatio(); deviceratio = deviceratio*2; - QPixmap pixmap(m_impl->m_terminalDisplay->size() * deviceratio); + QPixmap pixmap(m_terminalDisplay->size() * deviceratio); pixmap.setDevicePixelRatio(deviceratio); - m_impl->m_terminalDisplay->render(&pixmap); + m_terminalDisplay->render(&pixmap); pixmap.save(fileName); } void QTermWidget::setLocked(bool enabled) { this->setEnabled(!enabled); - m_impl->m_terminalDisplay->setLocked(enabled); + m_terminalDisplay->setLocked(enabled); } void QTermWidget::setDrawLineChars(bool drawLineChars) { - m_impl->m_terminalDisplay->setDrawLineChars(drawLineChars); + m_terminalDisplay->setDrawLineChars(drawLineChars); } void QTermWidget::setBoldIntense(bool boldIntense) { - m_impl->m_terminalDisplay->setBoldIntense(boldIntense); + m_terminalDisplay->setBoldIntense(boldIntense); } void QTermWidget::setConfirmMultilinePaste(bool confirmMultilinePaste) { - m_impl->m_terminalDisplay->setConfirmMultilinePaste(confirmMultilinePaste); + m_terminalDisplay->setConfirmMultilinePaste(confirmMultilinePaste); } void QTermWidget::setTrimPastedTrailingNewlines(bool trimPastedTrailingNewlines) { - m_impl->m_terminalDisplay->setTrimPastedTrailingNewlines(trimPastedTrailingNewlines); + m_terminalDisplay->setTrimPastedTrailingNewlines(trimPastedTrailingNewlines); } void QTermWidget::setEcho(bool echo) { @@ -804,7 +759,7 @@ void QTermWidget::setEcho(bool echo) { } void QTermWidget::setKeyboardCursorColor(bool useForegroundColor, const QColor& color) { - m_impl->m_terminalDisplay->setKeyboardCursorColor(useForegroundColor, color); + m_terminalDisplay->setKeyboardCursorColor(useForegroundColor, color); } void QTermWidget::addHighLightText(const QString &text, const QColor &color) @@ -816,9 +771,9 @@ void QTermWidget::addHighLightText(const QString &text, const QColor &color) } HighLightText *highLightText = new HighLightText(text,color); m_highLightTexts.append(highLightText); - m_impl->m_terminalDisplay->filterChain()->addFilter(highLightText->regExpFilter); - m_impl->m_terminalDisplay->updateFilters(); - m_impl->m_terminalDisplay->repaint(); + m_terminalDisplay->filterChain()->addFilter(highLightText->regExpFilter); + m_terminalDisplay->updateFilters(); + m_terminalDisplay->repaint(); } QMap QTermWidget::getHighLightTexts(void) @@ -844,74 +799,74 @@ void QTermWidget::removeHighLightText(const QString &text) { for (int i = 0; i < m_highLightTexts.size(); i++) { if (m_highLightTexts.at(i)->text == text) { - m_impl->m_terminalDisplay->filterChain()->removeFilter(m_highLightTexts.at(i)->regExpFilter); + m_terminalDisplay->filterChain()->removeFilter(m_highLightTexts.at(i)->regExpFilter); delete m_highLightTexts.at(i); m_highLightTexts.removeAt(i); - m_impl->m_terminalDisplay->updateFilters(); + m_terminalDisplay->updateFilters(); break; } } - m_impl->m_terminalDisplay->repaint(); + m_terminalDisplay->repaint(); } void QTermWidget::clearHighLightTexts(void) { for (int i = 0; i < m_highLightTexts.size(); i++) { - m_impl->m_terminalDisplay->filterChain()->removeFilter(m_highLightTexts.at(i)->regExpFilter); + m_terminalDisplay->filterChain()->removeFilter(m_highLightTexts.at(i)->regExpFilter); delete m_highLightTexts.at(i); } - m_impl->m_terminalDisplay->updateFilters(); + m_terminalDisplay->updateFilters(); m_highLightTexts.clear(); - m_impl->m_terminalDisplay->repaint(); + m_terminalDisplay->repaint(); } void QTermWidget::setWordCharacters(const QString &wordCharacters) { - m_impl->m_terminalDisplay->setWordCharacters(wordCharacters); + m_terminalDisplay->setWordCharacters(wordCharacters); } QString QTermWidget::wordCharacters(void) { - return m_impl->m_terminalDisplay->wordCharacters(); + return m_terminalDisplay->wordCharacters(); } void QTermWidget::setShowResizeNotificationEnabled(bool enabled) { - m_impl->m_terminalDisplay->setShowResizeNotificationEnabled(enabled); + m_terminalDisplay->setShowResizeNotificationEnabled(enabled); } void QTermWidget::setEnableHandleCtrlC(bool enable) { - m_impl->m_session->emulation()->setEnableHandleCtrlC(enable); + m_session->emulation()->setEnableHandleCtrlC(enable); } int QTermWidget::lines() { - return m_impl->m_terminalDisplay->lines(); + return m_terminalDisplay->lines(); } int QTermWidget::columns() { - return m_impl->m_terminalDisplay->columns(); + return m_terminalDisplay->columns(); } int QTermWidget::getCursorX() { - return m_impl->m_terminalDisplay->getCursorX(); + return m_terminalDisplay->getCursorX(); } int QTermWidget::getCursorY() { - return m_impl->m_terminalDisplay->getCursorY(); + return m_terminalDisplay->getCursorY(); } void QTermWidget::setCursorX(int x) { - m_impl->m_terminalDisplay->setCursorX(x); + m_terminalDisplay->setCursorX(x); } void QTermWidget::setCursorY(int y) { - m_impl->m_terminalDisplay->setCursorY(y); + m_terminalDisplay->setCursorY(y); } QString QTermWidget::screenGet(int row1, int col1, int row2, int col2, int mode) { - return m_impl->m_terminalDisplay->screenGet(row1, col1, row2, col2, mode); + return m_terminalDisplay->screenGet(row1, col1, row2, col2, mode); } void QTermWidget::setSelectionOpacity(qreal opacity) { - m_impl->m_terminalDisplay->setSelectionOpacity(opacity); + m_terminalDisplay->setSelectionOpacity(opacity); } void QTermWidget::setUrlFilterEnabled(bool enable) { @@ -919,15 +874,15 @@ void QTermWidget::setUrlFilterEnabled(bool enable) { return; } if(enable) { - m_impl->m_terminalDisplay->filterChain()->addFilter(urlFilter); + m_terminalDisplay->filterChain()->addFilter(urlFilter); } else { - m_impl->m_terminalDisplay->filterChain()->removeFilter(urlFilter); + m_terminalDisplay->filterChain()->removeFilter(urlFilter); } } void QTermWidget::setMessageParentWidget(QWidget *parent) { messageParentWidget = parent; - m_impl->m_terminalDisplay->setMessageParentWidget(messageParentWidget); + m_terminalDisplay->setMessageParentWidget(messageParentWidget); } void QTermWidget::reTranslateUi(void) { @@ -935,5 +890,5 @@ void QTermWidget::reTranslateUi(void) { } void QTermWidget::set_fix_quardCRT_issue33(bool fix) { - m_impl->m_terminalDisplay->set_fix_quardCRT_issue33(fix); + m_terminalDisplay->set_fix_quardCRT_issue33(fix); } diff --git a/lib/qtermwidget/qtermwidget.h b/lib/qtermwidget/qtermwidget.h index 64d89344..cbee2383 100644 --- a/lib/qtermwidget/qtermwidget.h +++ b/lib/qtermwidget/qtermwidget.h @@ -28,8 +28,9 @@ #include "Filter.h" class QVBoxLayout; -class TermWidgetImpl; class SearchBar; +class Session; +class TerminalDisplay; class QUrl; class QTermWidget : public QWidget { @@ -53,7 +54,7 @@ class QTermWidget : public QWidget { OpenFromClick = 2 }; - using KeyboardCursorShape = Konsole::Emulation::KeyboardCursorShape; + using KeyboardCursorShape = Emulation::KeyboardCursorShape; //Creation of widget QTermWidget(QWidget *messageParentWidget = nullptr, QWidget *parent = nullptr); @@ -379,7 +380,7 @@ private slots: * Emulation::cursorChanged() signal propagates to here and QTermWidget * sends the specified cursor states to the terminal display */ - void cursorChanged(Konsole::Emulation::KeyboardCursorShape cursorShape, bool blinkingCursorEnabled); + void cursorChanged(Emulation::KeyboardCursorShape cursorShape, bool blinkingCursorEnabled); void sizeChange(int lines, int columns){ emit termSizeChange(lines, columns); } @@ -388,7 +389,7 @@ private slots: class HighLightText { public: HighLightText(const QString& text, const QColor& color) : text(text), color(color) { - regExpFilter = new Konsole::RegExpFilter(); + regExpFilter = new RegExpFilter(); regExpFilter->setRegExp(QRegularExpression(text)); regExpFilter->setColor(color); } @@ -397,17 +398,18 @@ private slots: } QString text; QColor color; - Konsole::RegExpFilter *regExpFilter; + RegExpFilter *regExpFilter; }; void search(bool forwards, bool next); int setZoom(int step); QWidget *messageParentWidget = nullptr; - TermWidgetImpl * m_impl; + TerminalDisplay *m_terminalDisplay = nullptr; + Session *m_session = nullptr; SearchBar* m_searchBar; QVBoxLayout *m_layout; QList m_highLightTexts; bool m_echo = false; - Konsole::UrlFilter *urlFilter = nullptr; + UrlFilter *urlFilter = nullptr; bool m_UrlFilterEnable = true; }; diff --git a/lib/qtermwidget/qtermwidget_version.h b/lib/qtermwidget/qtermwidget_version.h index cf11eeb0..729e4376 100644 --- a/lib/qtermwidget/qtermwidget_version.h +++ b/lib/qtermwidget/qtermwidget_version.h @@ -15,8 +15,6 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - - #ifndef _Q_TERM_WIDGET_VERSION #define _Q_TERM_WIDGET_VERSION diff --git a/src/globaloptions/globaloptionswindow.cpp b/src/globaloptions/globaloptionswindow.cpp index d50116fa..76f6a7a6 100644 --- a/src/globaloptions/globaloptionswindow.cpp +++ b/src/globaloptions/globaloptionswindow.cpp @@ -434,7 +434,7 @@ void GlobalOptionsWindow::setAvailableColorSchemes(QStringList colorSchemes) globalOptionsAppearanceWidget->ui->comBoxColorSchemes->addItems(colorSchemes); globalOptionsAppearanceWidget->ui->comBoxColorSchemesBak->clear(); globalOptionsAppearanceWidget->ui->comBoxColorSchemesBak->addItems(colorSchemes); - const Konsole::ColorScheme *cs = Konsole::ColorSchemeManager::instance()->findColorScheme(defaultColorScheme); + const ColorScheme *cs = ColorSchemeManager::instance()->findColorScheme(defaultColorScheme); if(cs) cs->getColorTable(table); GlobalSetting settings; @@ -883,7 +883,7 @@ bool GlobalOptionsWindow::updateColorButtons(const QString &text) { } if (QTermWidget::availableColorSchemes().contains(text)) { - const Konsole::ColorScheme *cs = Konsole::ColorSchemeManager::instance()->findColorScheme(text); + const ColorScheme *cs = ColorSchemeManager::instance()->findColorScheme(text); if (cs) { cs->getColorTable(table); for(int i = 0; i < TABLE_COLORS; i++) { diff --git a/src/globaloptions/globaloptionswindow.h b/src/globaloptions/globaloptionswindow.h index 5aaed2e3..2d8fc51f 100644 --- a/src/globaloptions/globaloptionswindow.h +++ b/src/globaloptions/globaloptionswindow.h @@ -117,7 +117,7 @@ private slots: QStringListModel *model; QFont font; QString cursorColorStr; - Konsole::ColorEntry table[TABLE_COLORS]; + ColorEntry table[TABLE_COLORS]; }; #endif //GLOBALOPTIONSWINDOW_H