diff --git a/lib/Emulation.cpp b/lib/Emulation.cpp index 723f5d20..08267d26 100644 --- a/lib/Emulation.cpp +++ b/lib/Emulation.cpp @@ -39,9 +39,6 @@ #include -// KDE -//#include - // Konsole #include "KeyboardTranslator.h" #include "Screen.h" @@ -63,14 +60,14 @@ Emulation::Emulation() : _screen[1] = new Screen(40,80); _currentScreen = _screen[0]; - QObject::connect(&_bulkTimer1, SIGNAL(timeout()), this, SLOT(showBulk()) ); - QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) ); + QObject::connect(&_bulkTimer1, &QTimer::timeout, this, &Konsole::Emulation::showBulk); + QObject::connect(&_bulkTimer2, &QTimer::timeout, this, &Konsole::Emulation::showBulk); // listen for mouse status changes - connect(this , SIGNAL(programUsesMouseChanged(bool)) , - SLOT(usesMouseChanged(bool))); - connect(this , SIGNAL(programBracketedPasteModeChanged(bool)) , - SLOT(bracketedPasteModeChanged(bool))); + connect(this, &Konsole::Emulation::programUsesMouseChanged, + this, &Konsole::Emulation::usesMouseChanged); + connect(this, &Konsole::Emulation::programBracketedPasteModeChanged, + this, &Konsole::Emulation::bracketedPasteModeChanged); connect(this, &Emulation::cursorChanged, this, [this] (KeyboardCursorShape cursorShape, bool blinkingCursorEnabled) { emit titleChanged( 50, QString(QLatin1String("CursorShape=%1;BlinkingCursorEnabled=%2")) @@ -104,11 +101,11 @@ ScreenWindow* Emulation::createWindow() window->setScreen(_currentScreen); _windows << window; - connect(window , SIGNAL(selectionChanged()), - this , SLOT(bufferedUpdate())); + connect(window, &Konsole::ScreenWindow::selectionChanged, + this, &Konsole::Emulation::bufferedUpdate); - connect(this , SIGNAL(outputChanged()), - window , SLOT(notifyOutputChanged()) ); + connect(this, &Konsole::Emulation::outputChanged, + window, &Konsole::ScreenWindow::notifyOutputChanged); connect(this, &Emulation::handleCommandFromKeyboard, window, &ScreenWindow::handleCommandFromKeyboard); @@ -332,9 +329,6 @@ int Emulation::lineCount() const return _currentScreen->getLines() + _currentScreen->getHistLines(); } -#define BULK_TIMEOUT1 10 -#define BULK_TIMEOUT2 40 - void Emulation::showBulk() { _bulkTimer1.stop(); @@ -348,6 +342,9 @@ void Emulation::showBulk() void Emulation::bufferedUpdate() { + static const int BULK_TIMEOUT1 = 10; + static const int BULK_TIMEOUT2 = 40; + _bulkTimer1.setSingleShot(true); _bulkTimer1.start(BULK_TIMEOUT1); if (!_bulkTimer2.isActive()) diff --git a/lib/Emulation.h b/lib/Emulation.h index 7d2263b5..1217386e 100644 --- a/lib/Emulation.h +++ b/lib/Emulation.h @@ -510,8 +510,8 @@ private slots: private: bool _usesMouse; bool _bracketedPasteMode; - QTimer _bulkTimer1; - QTimer _bulkTimer2; + QTimer _bulkTimer1{this}; + QTimer _bulkTimer2{this}; }; diff --git a/lib/Vt102Emulation.cpp b/lib/Vt102Emulation.cpp index e74f8821..2a9aa131 100644 --- a/lib/Vt102Emulation.cpp +++ b/lib/Vt102Emulation.cpp @@ -24,20 +24,6 @@ #include "Vt102Emulation.h" #include "tools.h" -// XKB -//#include - -// this allows konsole to be compiled without XKB and XTEST extensions -// even though it might be available on a particular system. -#if defined(AVOID_XKB) - #undef HAVE_XKB -#endif - -#if defined(HAVE_XKB) - void scrolllock_set_off(); - void scrolllock_set_on(); -#endif - // Standard #include #include @@ -48,10 +34,6 @@ #include #include -// KDE -//#include -//#include - // Konsole #include "KeyboardTranslator.h" #include "Screen.h" @@ -66,7 +48,8 @@ Vt102Emulation::Vt102Emulation() _reportFocusEvents(false) { _titleUpdateTimer->setSingleShot(true); - QObject::connect(_titleUpdateTimer , SIGNAL(timeout()) , this , SLOT(updateTitle())); + QObject::connect(_titleUpdateTimer, &QTimer::timeout, + this, &Konsole::Vt102Emulation::updateTitle); initTokenizer(); reset();