diff --git a/src/Application.cpp b/src/Application.cpp index dee167807..3544036c1 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -71,10 +71,8 @@ MainWindow* Application::newMainWindow() { MainWindow* window = new MainWindow(); - connect(window, &Konsole::MainWindow::newWindowRequest, - this, &Konsole::Application::createWindow); - connect(window, &Konsole::MainWindow::viewDetached, - this, &Konsole::Application::detachView); + connect(window, &Konsole::MainWindow::newWindowRequest, this, &Konsole::Application::createWindow); + connect(window, &Konsole::MainWindow::viewDetached, this, &Konsole::Application::detachView); return window; } @@ -455,8 +453,7 @@ void Application::startBackgroundMode(MainWindow* window) action->setText(i18n("Toggle Background Window")); action->setGlobalShortcut(KShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_F12))); - connect(action, SIGNAL(triggered()), - this, SLOT(toggleBackgroundInstance())); + connect(action, &KAction::triggered, this, &Application::toggleBackgroundInstance); */ _backgroundInstance = window; } diff --git a/src/ColorSchemeEditor.cpp b/src/ColorSchemeEditor.cpp index 89c32f1be..766768d68 100644 --- a/src/ColorSchemeEditor.cpp +++ b/src/ColorSchemeEditor.cpp @@ -68,8 +68,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &ColorSchemeEditor::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &ColorSchemeEditor::reject); mainLayout->addWidget(buttonBox); connect(buttonBox->button(QDialogButtonBox::Apply), &QPushButton::clicked, this, &Konsole::ColorSchemeEditor::saveColorScheme); connect(okButton, &QPushButton::clicked, this, &Konsole::ColorSchemeEditor::saveColorScheme); @@ -80,8 +80,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) // description edit _ui->descriptionEdit->setClearButtonEnabled(true); - connect(_ui->descriptionEdit , &QLineEdit::textChanged , this , - &Konsole::ColorSchemeEditor::setDescription); + connect(_ui->descriptionEdit , &QLineEdit::textChanged , this , &Konsole::ColorSchemeEditor::setDescription); // transparency slider QFontMetrics metrics(font()); @@ -90,8 +89,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) connect(_ui->transparencySlider , &QSlider::valueChanged , this , &Konsole::ColorSchemeEditor::setTransparencyPercentLabel); // randomized background - connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this , - &Konsole::ColorSchemeEditor::setRandomizedBackgroundColor); + connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this , &Konsole::ColorSchemeEditor::setRandomizedBackgroundColor); // wallpaper stuff QFileSystemModel *dirModel = new QFileSystemModel(this); @@ -104,10 +102,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) _ui->wallpaperPath->setClearButtonEnabled(true); _ui->wallpaperSelectButton->setIcon(QIcon::fromTheme(QStringLiteral("image-x-generic"))); - connect(_ui->wallpaperSelectButton, &QToolButton::clicked, - this, &Konsole::ColorSchemeEditor::selectWallpaper); - connect(_ui->wallpaperPath, &QLineEdit::textChanged, - this, &Konsole::ColorSchemeEditor::wallpaperPathChanged); + connect(_ui->wallpaperSelectButton, &QToolButton::clicked, this, &Konsole::ColorSchemeEditor::selectWallpaper); + connect(_ui->wallpaperPath, &QLineEdit::textChanged, this, &Konsole::ColorSchemeEditor::wallpaperPathChanged); // color table _ui->colorTable->setColumnCount(3); @@ -129,8 +125,7 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent) _ui->colorTable->verticalHeader()->hide(); - connect(_ui->colorTable , &QTableWidget::itemClicked , this , - &Konsole::ColorSchemeEditor::editColorItem); + connect(_ui->colorTable , &QTableWidget::itemClicked , this , &Konsole::ColorSchemeEditor::editColorItem); // warning label when transparency is not available _ui->transparencyWarningWidget->setWordWrap(true); diff --git a/src/CopyInputDialog.cpp b/src/CopyInputDialog.cpp index fec9e54be..a518e02c2 100644 --- a/src/CopyInputDialog.cpp +++ b/src/CopyInputDialog.cpp @@ -46,8 +46,8 @@ CopyInputDialog::CopyInputDialog(QWidget* parent) QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &CopyInputDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &CopyInputDialog::reject); mainLayout->addWidget(buttonBox); setWindowModality(Qt::WindowModal); @@ -71,8 +71,7 @@ CopyInputDialog::CopyInputDialog(QWidget* parent) filterProxyModel->setSourceModel(_model); filterProxyModel->setFilterKeyColumn(-1); - connect(_ui->filterEdit, &QLineEdit::textChanged, - filterProxyModel, &QSortFilterProxyModel::setFilterFixedString); + connect(_ui->filterEdit, &QLineEdit::textChanged, filterProxyModel, &QSortFilterProxyModel::setFilterFixedString); _ui->sessionList->setModel(filterProxyModel); _ui->sessionList->setColumnHidden(0, true); // Hide number column diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index 3995845e0..b069c3bb7 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -93,8 +93,7 @@ EditProfileDialog::EditProfileDialog(QWidget* aParent) // not been updated since the last profile change and will need // to be refreshed when the user switches to them _pageNeedsUpdate.resize(_ui->tabWidget->count()); - connect(_ui->tabWidget, &QTabWidget::currentChanged, this, - &Konsole::EditProfileDialog::preparePage); + connect(_ui->tabWidget, &QTabWidget::currentChanged, this, &Konsole::EditProfileDialog::preparePage); createTempProfile(); } @@ -303,24 +302,16 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile) // signals and slots connect(_ui->dirSelectButton, &QToolButton::clicked, this, &Konsole::EditProfileDialog::selectInitialDir); connect(_ui->iconSelectButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::selectIcon); - connect(_ui->startInSameDirButton, &QCheckBox::toggled, this , - &Konsole::EditProfileDialog::startInSameDir); - connect(_ui->profileNameEdit, &QLineEdit::textChanged, this, - &Konsole::EditProfileDialog::profileNameChanged); - connect(_ui->initialDirEdit, &QLineEdit::textChanged, this, - &Konsole::EditProfileDialog::initialDirChanged); - connect(_ui->commandEdit, &QLineEdit::textChanged, this, - &Konsole::EditProfileDialog::commandChanged); - connect(_ui->environmentEditButton , &QPushButton::clicked, this, - &Konsole::EditProfileDialog::showEnvironmentEditor); + connect(_ui->startInSameDirButton, &QCheckBox::toggled, this , &Konsole::EditProfileDialog::startInSameDir); + connect(_ui->profileNameEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::profileNameChanged); + connect(_ui->initialDirEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::initialDirChanged); + connect(_ui->commandEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::commandChanged); + connect(_ui->environmentEditButton , &QPushButton::clicked, this, &Konsole::EditProfileDialog::showEnvironmentEditor); - connect(_ui->terminalColumnsEntry, static_cast(&KIntSpinBox::valueChanged), - this, &Konsole::EditProfileDialog::terminalColumnsEntryChanged); - connect(_ui->terminalRowsEntry, static_cast(&KIntSpinBox::valueChanged), - this, &Konsole::EditProfileDialog::terminalRowsEntryChanged); + connect(_ui->terminalColumnsEntry, static_cast(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::terminalColumnsEntryChanged); + connect(_ui->terminalRowsEntry, static_cast(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::terminalRowsEntryChanged); - connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::showTerminalSizeHint); + connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::showTerminalSizeHint); } void EditProfileDialog::showEnvironmentEditor() { @@ -350,18 +341,15 @@ void EditProfileDialog::setupTabsPage(const Profile::Ptr profile) _ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat()); _ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat()); - connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this, - &Konsole::EditProfileDialog::tabTitleFormatChanged); - connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::remoteTabTitleFormatChanged, this, - &Konsole::EditProfileDialog::remoteTabTitleFormatChanged); + connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::tabTitleFormatChanged, this, &Konsole::EditProfileDialog::tabTitleFormatChanged); + connect(_ui->renameTabWidget, &Konsole::RenameTabWidget::remoteTabTitleFormatChanged, this, &Konsole::EditProfileDialog::remoteTabTitleFormatChanged); // tab monitoring const int silenceSeconds = profile->silenceSeconds(); _ui->silenceSecondsSpinner->setValue(silenceSeconds); _ui->silenceSecondsSpinner->setSuffix(ki18ncp("Unit of time", " second", " seconds")); - connect(_ui->silenceSecondsSpinner, static_cast(&KIntSpinBox::valueChanged), - this, &Konsole::EditProfileDialog::silenceSecondsChanged); + connect(_ui->silenceSecondsSpinner, static_cast(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::silenceSecondsChanged); } void EditProfileDialog::terminalColumnsEntryChanged(int value) @@ -451,20 +439,14 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile) _ui->colorSchemeList->installEventFilter(this); _ui->colorSchemeList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); - connect(_ui->colorSchemeList->selectionModel(), - &QItemSelectionModel::selectionChanged, - this, &Konsole::EditProfileDialog::colorSchemeSelected); - connect(_ui->colorSchemeList, &QListView::entered, this, - &Konsole::EditProfileDialog::previewColorScheme); + connect(_ui->colorSchemeList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::EditProfileDialog::colorSchemeSelected); + connect(_ui->colorSchemeList, &QListView::entered, this, &Konsole::EditProfileDialog::previewColorScheme); updateColorSchemeButtons(); - connect(_ui->editColorSchemeButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::editColorScheme); - connect(_ui->removeColorSchemeButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::removeColorScheme); - connect(_ui->newColorSchemeButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::newColorScheme); + connect(_ui->editColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::editColorScheme); + connect(_ui->removeColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::removeColorScheme); + connect(_ui->newColorSchemeButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::newColorScheme); // setup font preview const bool antialias = profile->antiAliasFonts(); @@ -476,22 +458,17 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile) _ui->fontPreviewLabel->setFont(profileFont); setFontInputValue(profileFont); - connect(_ui->fontSizeInput, &KDoubleNumInput::valueChanged, this, - &Konsole::EditProfileDialog::setFontSize); - connect(_ui->selectFontButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::showFontDialog); + connect(_ui->fontSizeInput, &KDoubleNumInput::valueChanged, this, &Konsole::EditProfileDialog::setFontSize); + connect(_ui->selectFontButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::showFontDialog); // setup font smoothing _ui->antialiasTextButton->setChecked(antialias); - connect(_ui->antialiasTextButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::setAntialiasText); + connect(_ui->antialiasTextButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::setAntialiasText); _ui->boldIntenseButton->setChecked(profile->boldIntense()); - connect(_ui->boldIntenseButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::setBoldIntense); + connect(_ui->boldIntenseButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::setBoldIntense); _ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled()); - connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::toggleMouseWheelZoom); + connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom); } void EditProfileDialog::setAntialiasText(bool enable) { @@ -714,8 +691,7 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme) } _colorDialog = new ColorSchemeEditor(this); - connect(_colorDialog, &Konsole::ColorSchemeEditor::colorSchemeSaveRequested, - this, &Konsole::EditProfileDialog::saveColorScheme); + connect(_colorDialog, &Konsole::ColorSchemeEditor::colorSchemeSaveRequested, this, &Konsole::EditProfileDialog::saveColorScheme); _colorDialog->setup(colors, isNewScheme); _colorDialog->show(); @@ -846,18 +822,13 @@ void EditProfileDialog::setupKeyboardPage(const Profile::Ptr /* profile */) // setup translator list updateKeyBindingsList(true); - connect(_ui->keyBindingList->selectionModel(), - &QItemSelectionModel::selectionChanged, - this, &Konsole::EditProfileDialog::keyBindingSelected); - connect(_ui->newKeyBindingsButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::newKeyBinding); + connect(_ui->keyBindingList->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::EditProfileDialog::keyBindingSelected); + connect(_ui->newKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::newKeyBinding); updateKeyBindingsButtons(); - connect(_ui->editKeyBindingsButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::editKeyBinding); - connect(_ui->removeKeyBindingsButton, &QPushButton::clicked, this, - &Konsole::EditProfileDialog::removeKeyBinding); + connect(_ui->editKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::editKeyBinding); + connect(_ui->removeKeyBindingsButton, &QPushButton::clicked, this, &Konsole::EditProfileDialog::removeKeyBinding); } void EditProfileDialog::keyBindingSelected() { @@ -979,8 +950,7 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile) // setup scrollback type radio int scrollBackType = profile->property(Profile::HistoryMode); _ui->historySizeWidget->setMode(Enum::HistoryModeEnum(scrollBackType)); - connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historyModeChanged, - this, &Konsole::EditProfileDialog::historyModeChanged); + connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historyModeChanged, this, &Konsole::EditProfileDialog::historyModeChanged); // setup scrollback line count spinner const int historySize = profile->historySize(); @@ -998,8 +968,7 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile) setupRadio(pageamounts, scrollFullPage); // signals and slots - connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historySizeChanged, - this, &Konsole::EditProfileDialog::historySizeChanged); + connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historySizeChanged, this, &Konsole::EditProfileDialog::historySizeChanged); } void EditProfileDialog::historySizeChanged(int lineCount) @@ -1068,20 +1037,17 @@ void EditProfileDialog::setupMousePage(const Profile::Ptr profile) // interaction options _ui->wordCharacterEdit->setText(profile->wordCharacters()); - connect(_ui->wordCharacterEdit, &QLineEdit::textChanged, this, - &Konsole::EditProfileDialog::wordCharactersChanged); + connect(_ui->wordCharacterEdit, &QLineEdit::textChanged, this, &Konsole::EditProfileDialog::wordCharactersChanged); int tripleClickMode = profile->property(Profile::TripleClickMode); _ui->tripleClickModeCombo->setCurrentIndex(tripleClickMode); - connect(_ui->tripleClickModeCombo, static_cast(&KComboBox::activated), this, - &Konsole::EditProfileDialog::TripleClickModeChanged); + connect(_ui->tripleClickModeCombo, static_cast(&KComboBox::activated), this, &Konsole::EditProfileDialog::TripleClickModeChanged); _ui->openLinksByDirectClickButton->setEnabled(_ui->underlineLinksButton->isChecked()); _ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled()); - connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, - &Konsole::EditProfileDialog::toggleMouseWheelZoom); + connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this, &Konsole::EditProfileDialog::toggleMouseWheelZoom); } void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile) { @@ -1108,8 +1074,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile) const int lineSpacing = profile->lineSpacing(); _ui->lineSpacingSpinner->setValue(lineSpacing); - connect(_ui->lineSpacingSpinner, static_cast(&KIntSpinBox::valueChanged), - this, &Konsole::EditProfileDialog::lineSpacingChanged); + connect(_ui->lineSpacingSpinner, static_cast(&KIntSpinBox::valueChanged), this, &Konsole::EditProfileDialog::lineSpacingChanged); // cursor options if (profile->useCustomCursorColor()) @@ -1121,8 +1086,7 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile) connect(_ui->customCursorColorButton, &QRadioButton::clicked, this, &Konsole::EditProfileDialog::customCursorColor); connect(_ui->autoCursorColorButton, &QRadioButton::clicked, this, &Konsole::EditProfileDialog::autoCursorColor); - connect(_ui->customColorSelectButton, &KColorButton::changed, - this, &Konsole::EditProfileDialog::customCursorColorChanged); + connect(_ui->customColorSelectButton, &KColorButton::changed, this, &Konsole::EditProfileDialog::customCursorColorChanged); int shape = profile->property(Profile::CursorShape); _ui->cursorShapeCombo->setCurrentIndex(shape); diff --git a/src/Emulation.cpp b/src/Emulation.cpp index 0058e0f33..1989b16ab 100644 --- a/src/Emulation.cpp +++ b/src/Emulation.cpp @@ -51,10 +51,8 @@ Emulation::Emulation() : QObject::connect(&_bulkTimer2, &QTimer::timeout, this, &Konsole::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 , &Konsole::Emulation::programUsesMouseChanged , this, &Konsole::Emulation::usesMouseChanged); + connect(this , &Konsole::Emulation::programBracketedPasteModeChanged , this, &Konsole::Emulation::bracketedPasteModeChanged); } bool Emulation::programUsesMouse() const @@ -82,13 +80,10 @@ ScreenWindow* Emulation::createWindow() ScreenWindow* window = new ScreenWindow(_currentScreen); _windows << window; - connect(window , &Konsole::ScreenWindow::selectionChanged, - this , &Konsole::Emulation::bufferedUpdate); - connect(window, &Konsole::ScreenWindow::selectionChanged, - this, &Konsole::Emulation::checkSelectedText); + connect(window , &Konsole::ScreenWindow::selectionChanged, this , &Konsole::Emulation::bufferedUpdate); + connect(window, &Konsole::ScreenWindow::selectionChanged, this, &Konsole::Emulation::checkSelectedText); - connect(this , &Konsole::Emulation::outputChanged, - window , &Konsole::ScreenWindow::notifyOutputChanged); + connect(this , &Konsole::Emulation::outputChanged, window , &Konsole::ScreenWindow::notifyOutputChanged); return window; } diff --git a/src/HistorySizeDialog.cpp b/src/HistorySizeDialog.cpp index ae5513774..cc37d7973 100644 --- a/src/HistorySizeDialog.cpp +++ b/src/HistorySizeDialog.cpp @@ -44,8 +44,8 @@ HistorySizeDialog::HistorySizeDialog(QWidget* parent) QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &HistorySizeDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &HistorySizeDialog::reject); mainLayout->addWidget(buttonBox); setWindowModality(Qt::WindowModal); diff --git a/src/HistorySizeWidget.cpp b/src/HistorySizeWidget.cpp index f5614f685..c1b36d1a3 100644 --- a/src/HistorySizeWidget.cpp +++ b/src/HistorySizeWidget.cpp @@ -49,21 +49,18 @@ HistorySizeWidget::HistorySizeWidget(QWidget* parent) // focus and select the spinner automatically when appropriate _ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner); - connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , - _ui->historyLineSpinner , &KIntSpinBox::selectAll); + connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KIntSpinBox::selectAll); QButtonGroup* modeGroup = new QButtonGroup(this); modeGroup->addButton(_ui->noHistoryButton); modeGroup->addButton(_ui->fixedSizeHistoryButton); modeGroup->addButton(_ui->unlimitedHistoryButton); - connect(modeGroup, static_cast(&QButtonGroup::buttonClicked), - this, &Konsole::HistorySizeWidget::buttonClicked); + connect(modeGroup, static_cast(&QButtonGroup::buttonClicked), this, &Konsole::HistorySizeWidget::buttonClicked); _ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines")); this->setLineCount(HistorySizeWidget::DefaultLineCount); - connect(_ui->historyLineSpinner, static_cast(&KIntSpinBox::valueChanged), - this, &Konsole::HistorySizeWidget::historySizeChanged); + connect(_ui->historyLineSpinner, static_cast(&KIntSpinBox::valueChanged), this, &Konsole::HistorySizeWidget::historySizeChanged); } HistorySizeWidget::~HistorySizeWidget() diff --git a/src/IncrementalSearchBar.cpp b/src/IncrementalSearchBar.cpp index e54c271ea..130b23768 100644 --- a/src/IncrementalSearchBar.cpp +++ b/src/IncrementalSearchBar.cpp @@ -119,27 +119,23 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent) _caseSensitive = optionsMenu->addAction(i18nc("@item:inmenu", "Case sensitive")); _caseSensitive->setCheckable(true); _caseSensitive->setToolTip(i18nc("@info:tooltip", "Sets whether the search is case sensitive")); - connect(_caseSensitive, &QAction::toggled, - this, &Konsole::IncrementalSearchBar::matchCaseToggled); + connect(_caseSensitive, &QAction::toggled, this, &Konsole::IncrementalSearchBar::matchCaseToggled); _regExpression = optionsMenu->addAction(i18nc("@item:inmenu", "Match regular expression")); _regExpression->setCheckable(true); - connect(_regExpression, &QAction::toggled, - this, &Konsole::IncrementalSearchBar::matchRegExpToggled); + connect(_regExpression, &QAction::toggled, this, &Konsole::IncrementalSearchBar::matchRegExpToggled); _highlightMatches = optionsMenu->addAction(i18nc("@item:inmenu", "Highlight all matches")); _highlightMatches->setCheckable(true); _highlightMatches->setToolTip(i18nc("@info:tooltip", "Sets whether matching text should be highlighted")); _highlightMatches->setChecked(true); - connect(_highlightMatches, &QAction::toggled, - this, &Konsole::IncrementalSearchBar::highlightMatchesToggled); + connect(_highlightMatches, &QAction::toggled, this, &Konsole::IncrementalSearchBar::highlightMatchesToggled); _reverseSearch = optionsMenu->addAction(i18n("Search backwards")); _reverseSearch->setCheckable(true); _reverseSearch->setToolTip(i18n("Sets whether search should start from the bottom")); _reverseSearch->setChecked(true); - connect(_reverseSearch, &QAction::toggled, - this, &Konsole::IncrementalSearchBar::updateButtonsAccordingToReverseSearchSetting); + connect(_reverseSearch, &QAction::toggled, this, &Konsole::IncrementalSearchBar::updateButtonsAccordingToReverseSearchSetting); updateButtonsAccordingToReverseSearchSetting(); barLayout->addStretch(); diff --git a/src/KeyBindingEditor.cpp b/src/KeyBindingEditor.cpp index 9fb3b2f58..e227e008e 100644 --- a/src/KeyBindingEditor.cpp +++ b/src/KeyBindingEditor.cpp @@ -41,8 +41,7 @@ KeyBindingEditor::KeyBindingEditor(QWidget* parent) _ui->setupUi(this); // description edit - connect(_ui->descriptionEdit , &QLineEdit::textChanged , - this , &Konsole::KeyBindingEditor::setTranslatorDescription); + connect(_ui->descriptionEdit , &QLineEdit::textChanged , this , &Konsole::KeyBindingEditor::setTranslatorDescription); // key bindings table _ui->keyBindingTable->setColumnCount(2); @@ -227,7 +226,6 @@ void KeyBindingEditor::setupKeyBindingTable(const KeyboardTranslator* translator } _ui->keyBindingTable->sortItems(0); - connect(_ui->keyBindingTable , &QTableWidget::itemChanged , this , - &Konsole::KeyBindingEditor::bindingTableItemChanged); + connect(_ui->keyBindingTable , &QTableWidget::itemChanged , this , &Konsole::KeyBindingEditor::bindingTableItemChanged); } diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c9d14e4d1..048f25128 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -87,7 +87,7 @@ MainWindow::MainWindow() } } - connect(KWindowSystem::self(), SIGNAL(compositingChanged(bool)), this, SLOT(updateUseTransparency())); + connect(KWindowSystem::self(), &KWindowSystem::compositingChanged, this, &MainWindow::updateUseTransparency); updateUseTransparency(); @@ -97,21 +97,14 @@ MainWindow::MainWindow() // create view manager _viewManager = new ViewManager(this, actionCollection()); connect(_viewManager, &Konsole::ViewManager::empty, this, &Konsole::MainWindow::close); - connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this, - &Konsole::MainWindow::activeViewChanged); - connect(_viewManager, &Konsole::ViewManager::unplugController, this, - &Konsole::MainWindow::disconnectController); - connect(_viewManager, &Konsole::ViewManager::viewPropertiesChanged, - bookmarkHandler(), &Konsole::BookmarkHandler::setViews); + connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this, &Konsole::MainWindow::activeViewChanged); + connect(_viewManager, &Konsole::ViewManager::unplugController, this, &Konsole::MainWindow::disconnectController); + connect(_viewManager, &Konsole::ViewManager::viewPropertiesChanged, bookmarkHandler(), &Konsole::BookmarkHandler::setViews); - connect(_viewManager, &Konsole::ViewManager::updateWindowIcon, this, - &Konsole::MainWindow::updateWindowIcon); - connect(_viewManager, static_cast(&Konsole::ViewManager::newViewRequest), - this, &Konsole::MainWindow::newFromProfile); - connect(_viewManager, static_cast(&Konsole::ViewManager::newViewRequest), - this, &Konsole::MainWindow::newTab); - connect(_viewManager, &Konsole::ViewManager::viewDetached, - this, &Konsole::MainWindow::viewDetached); + connect(_viewManager, &Konsole::ViewManager::updateWindowIcon, this, &Konsole::MainWindow::updateWindowIcon); + connect(_viewManager, static_cast(&Konsole::ViewManager::newViewRequest), this, &Konsole::MainWindow::newFromProfile); + connect(_viewManager, static_cast(&Konsole::ViewManager::newViewRequest), this, &Konsole::MainWindow::newTab); + connect(_viewManager, &Konsole::ViewManager::viewDetached, this, &Konsole::MainWindow::viewDetached); // create the main widget setupMainWidget(); @@ -225,8 +218,7 @@ void MainWindow::activeViewChanged(SessionController* controller) // associate bookmark menu with current session bookmarkHandler()->setActiveView(controller); disconnect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, 0, 0); - connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller, - &Konsole::SessionController::openUrl); + connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller, &Konsole::SessionController::openUrl); if (_pluggedController) disconnectController(_pluggedController); @@ -235,10 +227,8 @@ void MainWindow::activeViewChanged(SessionController* controller) _pluggedController = controller; // listen for title changes from the current session - connect(controller, &Konsole::SessionController::titleChanged, - this, &Konsole::MainWindow::activeViewTitleChanged); - connect(controller, &Konsole::SessionController::rawTitleChanged, - this, &Konsole::MainWindow::updateWindowCaption); + connect(controller, &Konsole::SessionController::titleChanged, this, &Konsole::MainWindow::activeViewTitleChanged); + connect(controller, &Konsole::SessionController::rawTitleChanged, this, &Konsole::MainWindow::updateWindowCaption); controller->setShowMenuAction(_toggleMenuBarAction); guiFactory()->addClient(controller); @@ -373,11 +363,9 @@ void MainWindow::setProfileList(ProfileList* list) { profileListChanged(list->actions()); - connect(list, &Konsole::ProfileList::profileSelected, this, - &Konsole::MainWindow::newFromProfile); + connect(list, &Konsole::ProfileList::profileSelected, this, &Konsole::MainWindow::newFromProfile); - connect(list, &Konsole::ProfileList::actionsChanged, this, - &Konsole::MainWindow::profileListChanged); + connect(list, &Konsole::ProfileList::actionsChanged, this, &Konsole::MainWindow::profileListChanged); } void MainWindow::profileListChanged(const QList& sessionActions) diff --git a/src/ManageProfilesDialog.cpp b/src/ManageProfilesDialog.cpp index c1e685204..5cc32df22 100644 --- a/src/ManageProfilesDialog.cpp +++ b/src/ManageProfilesDialog.cpp @@ -56,8 +56,8 @@ ManageProfilesDialog::ManageProfilesDialog(QWidget* aParent) QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->addWidget(mainWidget); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(slotAccepted())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &ManageProfilesDialog::slotAccepted); + connect(buttonBox, &QDialogButtonBox::rejected, this, &ManageProfilesDialog::reject); mainLayout->addWidget(buttonBox); @@ -76,15 +76,10 @@ ManageProfilesDialog::ManageProfilesDialog(QWidget* aParent) populateTable(); // listen for changes to profiles - connect(ProfileManager::instance(), &Konsole::ProfileManager::profileAdded, this, - &Konsole::ManageProfilesDialog::addItems); - connect(ProfileManager::instance(), &Konsole::ProfileManager::profileRemoved, this, - &Konsole::ManageProfilesDialog::removeItems); - connect(ProfileManager::instance(), &Konsole::ProfileManager::profileChanged, this, - &Konsole::ManageProfilesDialog::updateItems); - connect(ProfileManager::instance() , - &Konsole::ProfileManager::favoriteStatusChanged, this, - &Konsole::ManageProfilesDialog::updateFavoriteStatus); + connect(ProfileManager::instance(), &Konsole::ProfileManager::profileAdded, this, &Konsole::ManageProfilesDialog::addItems); + connect(ProfileManager::instance(), &Konsole::ProfileManager::profileRemoved, this, &Konsole::ManageProfilesDialog::removeItems); + connect(ProfileManager::instance(), &Konsole::ProfileManager::profileChanged, this, &Konsole::ManageProfilesDialog::updateItems); + connect(ProfileManager::instance() , &Konsole::ProfileManager::favoriteStatusChanged, this, &Konsole::ManageProfilesDialog::updateFavoriteStatus); // resize the session table to the full width of the table _ui->sessionTable->horizontalHeader()->setHighlightSections(false); @@ -244,17 +239,14 @@ void ManageProfilesDialog::populateTable() } updateDefaultItem(); - connect(_sessionModel, &QStandardItemModel::itemChanged, this, - &Konsole::ManageProfilesDialog::itemDataChanged); + connect(_sessionModel, &QStandardItemModel::itemChanged, this, &Konsole::ManageProfilesDialog::itemDataChanged); // listen for changes in the table selection and update the state of the form's buttons // accordingly. // // it appears that the selection model is changed when the model itself is replaced, // so the signals need to be reconnected each time the model is updated. - connect(_ui->sessionTable->selectionModel(), - &QItemSelectionModel::selectionChanged, this, - &Konsole::ManageProfilesDialog::tableSelectionChanged); + connect(_ui->sessionTable->selectionModel(), &QItemSelectionModel::selectionChanged, this, &Konsole::ManageProfilesDialog::tableSelectionChanged); _ui->sessionTable->selectRow(0); } diff --git a/src/Part.cpp b/src/Part.cpp index 7d20f8ed2..cb556cc9c 100644 --- a/src/Part.cpp +++ b/src/Part.cpp @@ -64,8 +64,7 @@ Part::Part(QWidget* parentWidget , QObject* parent, const QVariantList&) _viewManager = new ViewManager(this, actionCollection()); _viewManager->setNavigationMethod(ViewManager::NoNavigation); - connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this , - &Konsole::Part::activeViewChanged); + connect(_viewManager, &Konsole::ViewManager::activeViewChanged, this , &Konsole::Part::activeViewChanged); connect(_viewManager, &Konsole::ViewManager::empty, this, &Konsole::Part::terminalExited); connect(_viewManager, static_cast(&Konsole::ViewManager::newViewRequest), this, &Konsole::Part::newTab); @@ -246,11 +245,9 @@ void Part::activeViewChanged(SessionController* controller) insertChildClient(controller); setupActionsForSession(controller); - connect(controller, &Konsole::SessionController::titleChanged, this, - &Konsole::Part::activeViewTitleChanged); + connect(controller, &Konsole::SessionController::titleChanged, this, &Konsole::Part::activeViewTitleChanged); activeViewTitleChanged(controller); - connect(controller, &Konsole::SessionController::currentDirectoryChanged, this, - &Konsole::Part::currentDirectoryChanged); + connect(controller, &Konsole::SessionController::currentDirectoryChanged, this, &Konsole::Part::currentDirectoryChanged); const char* displaySignal = SIGNAL(overrideShortcutCheck(QKeyEvent*,bool&)); const char* partSlot = SLOT(overrideTerminalShortcut(QKeyEvent*,bool&)); diff --git a/src/ProfileList.cpp b/src/ProfileList.cpp index 2ebf0b4cc..ca6c3daa3 100644 --- a/src/ProfileList.cpp +++ b/src/ProfileList.cpp @@ -57,12 +57,9 @@ ProfileList::ProfileList(bool addShortcuts , QObject* parent) connect(_group, &QActionGroup::triggered, this, &Konsole::ProfileList::triggered); // listen for future changes to the profiles - connect(manager, &Konsole::ProfileManager::favoriteStatusChanged, this, - &Konsole::ProfileList::favoriteChanged); - connect(manager, &Konsole::ProfileManager::shortcutChanged, this, - &Konsole::ProfileList::shortcutChanged); - connect(manager, &Konsole::ProfileManager::profileChanged, this, - &Konsole::ProfileList::profileChanged); + connect(manager, &Konsole::ProfileManager::favoriteStatusChanged, this, &Konsole::ProfileList::favoriteChanged); + connect(manager, &Konsole::ProfileManager::shortcutChanged, this, &Konsole::ProfileList::shortcutChanged); + connect(manager, &Konsole::ProfileManager::profileChanged, this, &Konsole::ProfileList::profileChanged); } void ProfileList::updateEmptyAction() { diff --git a/src/RenameTabDialog.cpp b/src/RenameTabDialog.cpp index 0d3c1b401..47ea6ffe9 100644 --- a/src/RenameTabDialog.cpp +++ b/src/RenameTabDialog.cpp @@ -43,8 +43,8 @@ RenameTabDialog::RenameTabDialog(QWidget* parent) QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(buttonBox, &QDialogButtonBox::accepted, this, &RenameTabDialog::accept); + connect(buttonBox, &QDialogButtonBox::rejected, this, &RenameTabDialog::reject); mainLayout->addWidget(buttonBox); setWindowModality(Qt::WindowModal); diff --git a/src/RenameTabWidget.cpp b/src/RenameTabWidget.cpp index b43c73f64..ee344b696 100644 --- a/src/RenameTabWidget.cpp +++ b/src/RenameTabWidget.cpp @@ -34,18 +34,14 @@ RenameTabWidget::RenameTabWidget(QWidget* parent) _ui->tabTitleEdit->setClearButtonEnabled(true); _ui->remoteTabTitleEdit->setClearButtonEnabled(true); - connect(_ui->tabTitleEdit, &QLineEdit::textChanged, this, - &Konsole::RenameTabWidget::tabTitleFormatChanged); - connect(_ui->remoteTabTitleEdit, &QLineEdit::textChanged, this, - &Konsole::RenameTabWidget::remoteTabTitleFormatChanged); + connect(_ui->tabTitleEdit, &QLineEdit::textChanged, this, &Konsole::RenameTabWidget::tabTitleFormatChanged); + connect(_ui->remoteTabTitleEdit, &QLineEdit::textChanged, this, &Konsole::RenameTabWidget::remoteTabTitleFormatChanged); _ui->tabTitleFormatButton->setContext(Session::LocalTabTitle); - connect(_ui->tabTitleFormatButton, &Konsole::TabTitleFormatButton::dynamicElementSelected, - this, &Konsole::RenameTabWidget::insertTabTitleText); + connect(_ui->tabTitleFormatButton, &Konsole::TabTitleFormatButton::dynamicElementSelected, this, &Konsole::RenameTabWidget::insertTabTitleText); _ui->remoteTabTitleFormatButton->setContext(Session::RemoteTabTitle); - connect(_ui->remoteTabTitleFormatButton, &Konsole::TabTitleFormatButton::dynamicElementSelected, - this, &Konsole::RenameTabWidget::insertRemoteTabTitleText); + connect(_ui->remoteTabTitleFormatButton, &Konsole::TabTitleFormatButton::dynamicElementSelected, this, &Konsole::RenameTabWidget::insertRemoteTabTitleText); } RenameTabWidget::~RenameTabWidget() diff --git a/src/Session.cpp b/src/Session.cpp index 7c9fdce61..cf70c0998 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -126,24 +126,15 @@ Session::Session(QObject* parent) : //create emulation backend _emulation = new Vt102Emulation(); - connect(_emulation, &Konsole::Emulation::titleChanged, - this, &Konsole::Session::setUserTitle); - connect(_emulation, &Konsole::Emulation::stateSet, - this, &Konsole::Session::activityStateSet); - connect(_emulation, &Konsole::Emulation::zmodemDetected, - this, &Konsole::Session::fireZModemDetected); - connect(_emulation, &Konsole::Emulation::changeTabTextColorRequest, - this, &Konsole::Session::changeTabTextColorRequest); - connect(_emulation, &Konsole::Emulation::profileChangeCommandReceived, - this, &Konsole::Session::profileChangeCommandReceived); - connect(_emulation, &Konsole::Emulation::flowControlKeyPressed, - this, &Konsole::Session::updateFlowControlState); - connect(_emulation, &Konsole::Emulation::primaryScreenInUse, - this, &Konsole::Session::onPrimaryScreenInUse); - connect(_emulation, &Konsole::Emulation::selectionChanged, - this, &Konsole::Session::selectionChanged); - connect(_emulation, &Konsole::Emulation::imageResizeRequest, - this, &Konsole::Session::resizeRequest); + connect(_emulation, &Konsole::Emulation::titleChanged, this, &Konsole::Session::setUserTitle); + connect(_emulation, &Konsole::Emulation::stateSet, this, &Konsole::Session::activityStateSet); + connect(_emulation, &Konsole::Emulation::zmodemDetected, this, &Konsole::Session::fireZModemDetected); + connect(_emulation, &Konsole::Emulation::changeTabTextColorRequest, this, &Konsole::Session::changeTabTextColorRequest); + connect(_emulation, &Konsole::Emulation::profileChangeCommandReceived, this, &Konsole::Session::profileChangeCommandReceived); + connect(_emulation, &Konsole::Emulation::flowControlKeyPressed, this, &Konsole::Session::updateFlowControlState); + connect(_emulation, &Konsole::Emulation::primaryScreenInUse, this, &Konsole::Session::onPrimaryScreenInUse); + connect(_emulation, &Konsole::Emulation::selectionChanged, this, &Konsole::Session::selectionChanged); + connect(_emulation, &Konsole::Emulation::imageResizeRequest, this, &Konsole::Session::resizeRequest); //create new teletype for I/O with shell process openTeletype(-1); @@ -184,24 +175,18 @@ void Session::openTeletype(int fd) _shellProcess->setUtf8Mode(_emulation->utf8()); // connect the I/O between emulator and pty process - connect(_shellProcess, &Konsole::Pty::receivedData, - this, &Konsole::Session::onReceiveBlock); - connect(_emulation, &Konsole::Emulation::sendData, - _shellProcess, &Konsole::Pty::sendData); + connect(_shellProcess, &Konsole::Pty::receivedData, this, &Konsole::Session::onReceiveBlock); + connect(_emulation, &Konsole::Emulation::sendData, _shellProcess, &Konsole::Pty::sendData); // UTF8 mode - connect(_emulation, &Konsole::Emulation::useUtf8Request, - _shellProcess, &Konsole::Pty::setUtf8Mode); + connect(_emulation, &Konsole::Emulation::useUtf8Request, _shellProcess, &Konsole::Pty::setUtf8Mode); // get notified when the pty process is finished - connect(_shellProcess, static_cast(&Konsole::Pty::finished), - this, &Konsole::Session::done); + connect(_shellProcess, static_cast(&Konsole::Pty::finished), this, &Konsole::Session::done); // emulator size - connect(_emulation, &Konsole::Emulation::imageSizeChanged, - this, &Konsole::Session::updateWindowSize); - connect(_emulation, &Konsole::Emulation::imageSizeInitialized, - this, &Konsole::Session::run); + connect(_emulation, &Konsole::Emulation::imageSizeChanged, this, &Konsole::Session::updateWindowSize); + connect(_emulation, &Konsole::Emulation::imageSizeInitialized, this, &Konsole::Session::run); } WId Session::windowId() const @@ -312,33 +297,26 @@ void Session::addView(TerminalDisplay* widget) _views.append(widget); // connect emulation - view signals and slots - connect(widget, &Konsole::TerminalDisplay::keyPressedSignal, - _emulation, &Konsole::Emulation::sendKeyEvent); - connect(widget, &Konsole::TerminalDisplay::mouseSignal, - _emulation, &Konsole::Emulation::sendMouseEvent); - connect(widget, &Konsole::TerminalDisplay::sendStringToEmu, - _emulation, &Konsole::Emulation::sendString); + connect(widget, &Konsole::TerminalDisplay::keyPressedSignal, _emulation, &Konsole::Emulation::sendKeyEvent); + connect(widget, &Konsole::TerminalDisplay::mouseSignal, _emulation, &Konsole::Emulation::sendMouseEvent); + connect(widget, &Konsole::TerminalDisplay::sendStringToEmu, _emulation, &Konsole::Emulation::sendString); // allow emulation to notify view when the foreground process // indicates whether or not it is interested in mouse signals - connect(_emulation, &Konsole::Emulation::programUsesMouseChanged, - widget, &Konsole::TerminalDisplay::setUsesMouse); + connect(_emulation, &Konsole::Emulation::programUsesMouseChanged, widget, &Konsole::TerminalDisplay::setUsesMouse); widget->setUsesMouse(_emulation->programUsesMouse()); - connect(_emulation, &Konsole::Emulation::programBracketedPasteModeChanged, - widget, &Konsole::TerminalDisplay::setBracketedPasteMode); + connect(_emulation, &Konsole::Emulation::programBracketedPasteModeChanged, widget, &Konsole::TerminalDisplay::setBracketedPasteMode); widget->setBracketedPasteMode(_emulation->programBracketedPasteMode()); widget->setScreenWindow(_emulation->createWindow()); //connect view signals and slots - connect(widget, &Konsole::TerminalDisplay::changedContentSizeSignal, - this, &Konsole::Session::onViewSizeChange); + connect(widget, &Konsole::TerminalDisplay::changedContentSizeSignal, this, &Konsole::Session::onViewSizeChange); - connect(widget, &Konsole::TerminalDisplay::destroyed, - this, &Konsole::Session::viewDestroyed); + connect(widget, &Konsole::TerminalDisplay::destroyed, this, &Konsole::Session::viewDestroyed); } void Session::viewDestroyed(QObject* view) @@ -1185,25 +1163,20 @@ void Session::startZModem(const QString& zmodem, const QString& dir, const QStri if (!dir.isEmpty()) _zmodemProc->setWorkingDirectory(dir); - connect(_zmodemProc, &KProcess::readyReadStandardOutput, - this, &Konsole::Session::zmodemReadAndSendBlock); - connect(_zmodemProc, &KProcess::readyReadStandardError, - this, &Konsole::Session::zmodemReadStatus); - connect(_zmodemProc, static_cast(&KProcess::finished), - this, &Konsole::Session::zmodemFinished); + connect(_zmodemProc, &KProcess::readyReadStandardOutput, this, &Konsole::Session::zmodemReadAndSendBlock); + connect(_zmodemProc, &KProcess::readyReadStandardError, this, &Konsole::Session::zmodemReadStatus); + connect(_zmodemProc, static_cast(&KProcess::finished), this, &Konsole::Session::zmodemFinished); _zmodemProc->start(); disconnect(_shellProcess, &Konsole::Pty::receivedData, this, &Konsole::Session::onReceiveBlock); - connect(_shellProcess, &Konsole::Pty::receivedData, - this, &Konsole::Session::zmodemReceiveBlock); + connect(_shellProcess, &Konsole::Pty::receivedData, this, &Konsole::Session::zmodemReceiveBlock); _zmodemProgress = new ZModemDialog(QApplication::activeWindow(), false, i18n("ZModem Progress")); - connect(_zmodemProgress, &Konsole::ZModemDialog::user1Clicked, - this, &Konsole::Session::zmodemFinished); + connect(_zmodemProgress, &Konsole::ZModemDialog::user1Clicked, this, &Konsole::Session::zmodemFinished); _zmodemProgress->show(); } @@ -1262,8 +1235,7 @@ void Session::zmodemFinished() disconnect(_shellProcess, &Konsole::Pty::receivedData, this , &Konsole::Session::zmodemReceiveBlock); - connect(_shellProcess, &Konsole::Pty::receivedData, - this, &Konsole::Session::onReceiveBlock); + connect(_shellProcess, &Konsole::Pty::receivedData, this, &Konsole::Session::onReceiveBlock); _shellProcess->sendData(QByteArrayLiteral("\030\030\030\030")); // Abort _shellProcess->sendData(QByteArrayLiteral("\001\013\n")); // Try to get prompt back @@ -1497,8 +1469,7 @@ void SessionGroup::setMasterStatus(Session* session , bool master) _sessions[session] = master; if (master) { - connect(session->emulation(), &Konsole::Emulation::sendData, - this, &Konsole::SessionGroup::forwardData); + connect(session->emulation(), &Konsole::Emulation::sendData, this, &Konsole::SessionGroup::forwardData); } else { disconnect(session->emulation(), &Konsole::Emulation::sendData, this, &Konsole::SessionGroup::forwardData); diff --git a/src/SessionController.cpp b/src/SessionController.cpp index a616c59b5..edb00a744 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -146,25 +146,20 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q view->setSessionController(this); // listen for session resize requests - connect(_session.data(), &Konsole::Session::resizeRequest, this, - &Konsole::SessionController::sessionResizeRequest); + connect(_session.data(), &Konsole::Session::resizeRequest, this, &Konsole::SessionController::sessionResizeRequest); // listen for popup menu requests - connect(_view.data(), &Konsole::TerminalDisplay::configureRequest, this, - &Konsole::SessionController::showDisplayContextMenu); + connect(_view.data(), &Konsole::TerminalDisplay::configureRequest, this, &Konsole::SessionController::showDisplayContextMenu); // move view to newest output when keystrokes occur - connect(_view.data(), &Konsole::TerminalDisplay::keyPressedSignal, this, - &Konsole::SessionController::trackOutput); + connect(_view.data(), &Konsole::TerminalDisplay::keyPressedSignal, this, &Konsole::SessionController::trackOutput); // listen to activity / silence notifications from session - connect(_session.data(), &Konsole::Session::stateChanged, this, - &Konsole::SessionController::sessionStateChanged); + connect(_session.data(), &Konsole::Session::stateChanged, this, &Konsole::SessionController::sessionStateChanged); // listen to title and icon changes connect(_session.data(), &Konsole::Session::titleChanged, this, &Konsole::SessionController::sessionTitleChanged); - connect(_session.data() , &Konsole::Session::currentDirectoryChanged , - this , &Konsole::SessionController::currentDirectoryChanged); + connect(_session.data() , &Konsole::Session::currentDirectoryChanged , this , &Konsole::SessionController::currentDirectoryChanged); // listen for color changes connect(_session.data(), &Konsole::Session::changeBackgroundColorRequest, _view.data(), &Konsole::TerminalDisplay::setBackgroundColor); @@ -174,15 +169,13 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q connect(_session.data(), &Konsole::Session::started, this, &Konsole::SessionController::snapshot); // listen for output changes to set activity flag - connect(_session->emulation(), &Konsole::Emulation::outputChanged, this, - &Konsole::SessionController::fireActivity); + connect(_session->emulation(), &Konsole::Emulation::outputChanged, this, &Konsole::SessionController::fireActivity); // listen for detection of ZModem transfer connect(_session.data(), &Konsole::Session::zmodemDetected, this, &Konsole::SessionController::zmodemDownload); // listen for flow control status changes - connect(_session.data(), &Konsole::Session::flowControlEnabledChanged, _view.data(), - &Konsole::TerminalDisplay::setFlowControlWarningEnabled); + connect(_session.data(), &Konsole::Session::flowControlEnabledChanged, _view.data(), &Konsole::TerminalDisplay::setFlowControlWarningEnabled); _view->setFlowControlWarningEnabled(_session->flowControlEnabled()); // take a snapshot of the session state every so often when @@ -468,8 +461,7 @@ bool SessionController::eventFilter(QObject* watched , QEvent* event) // first, disconnect any other views which are listening for bell signals from the session disconnect(_session.data(), &Konsole::Session::bellRequest, 0, 0); // second, connect the newly focused view to listen for the session's bell signal - connect(_session.data(), &Konsole::Session::bellRequest, - _view.data(), &Konsole::TerminalDisplay::bell); + connect(_session.data(), &Konsole::Session::bellRequest, _view.data(), &Konsole::TerminalDisplay::bell); if (_copyInputToAllTabsAction && _copyInputToAllTabsAction->isChecked()) { // A session with "Copy To All Tabs" has come into focus: @@ -487,10 +479,8 @@ bool SessionController::eventFilter(QObject* watched , QEvent* event) (!_viewUrlFilter || _urlFilterUpdateRequired) && ((QMouseEvent*)event)->buttons() == Qt::NoButton) { if (_view->screenWindow() && !_viewUrlFilter) { - connect(_view->screenWindow(), &Konsole::ScreenWindow::scrolled, this, - &Konsole::SessionController::requireUrlFilterUpdate); - connect(_view->screenWindow(), &Konsole::ScreenWindow::outputChanged, this, - &Konsole::SessionController::requireUrlFilterUpdate); + connect(_view->screenWindow(), &Konsole::ScreenWindow::scrolled, this, &Konsole::SessionController::requireUrlFilterUpdate); + connect(_view->screenWindow(), &Konsole::ScreenWindow::outputChanged, this, &Konsole::SessionController::requireUrlFilterUpdate); // install filter on the view to highlight URLs _viewUrlFilter = new UrlFilter(); @@ -1113,12 +1103,9 @@ void SessionController::listenForScreenWindowUpdates() if (_listenForScreenWindowUpdates) return; - connect(_view->screenWindow(), &Konsole::ScreenWindow::outputChanged, this, - &Konsole::SessionController::updateSearchFilter); - connect(_view->screenWindow(), &Konsole::ScreenWindow::scrolled, this, - &Konsole::SessionController::updateSearchFilter); - connect(_view->screenWindow(), &Konsole::ScreenWindow::currentResultLineChanged, _view.data(), - static_cast(&Konsole::TerminalDisplay::update)); + connect(_view->screenWindow(), &Konsole::ScreenWindow::outputChanged, this, &Konsole::SessionController::updateSearchFilter); + connect(_view->screenWindow(), &Konsole::ScreenWindow::scrolled, this, &Konsole::SessionController::updateSearchFilter); + connect(_view->screenWindow(), &Konsole::ScreenWindow::currentResultLineChanged, _view.data(), static_cast(&Konsole::TerminalDisplay::update)); _listenForScreenWindowUpdates = true; } @@ -1155,12 +1142,9 @@ void SessionController::enableSearchBar(bool showSearchBar) _searchBar->setVisible(showSearchBar); if (showSearchBar) { - connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchChanged, this, - &Konsole::SessionController::searchTextChanged); - connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchReturnPressed, this, - &Konsole::SessionController::findPreviousInHistory); - connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchShiftPlusReturnPressed, this, - &Konsole::SessionController::findNextInHistory); + connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchChanged, this, &Konsole::SessionController::searchTextChanged); + connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchReturnPressed, this, &Konsole::SessionController::findPreviousInHistory); + connect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchShiftPlusReturnPressed, this, &Konsole::SessionController::findNextInHistory); } else { disconnect(_searchBar.data(), &Konsole::IncrementalSearchBar::searchChanged, this, &Konsole::SessionController::searchTextChanged); @@ -1742,10 +1726,8 @@ void SaveHistoryTask::execute() _jobSession.insert(job, jobInfo); - connect(job, &KIO::TransferJob::dataReq, - this, &Konsole::SaveHistoryTask::jobDataRequested); - connect(job, &KIO::TransferJob::result, - this, &Konsole::SaveHistoryTask::jobResult); + connect(job, &KIO::TransferJob::dataReq, this, &Konsole::SaveHistoryTask::jobDataRequested); + connect(job, &KIO::TransferJob::result, this, &Konsole::SaveHistoryTask::jobResult); } dialog->deleteLater(); diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 4836954c3..3b57c6d13 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -44,12 +44,10 @@ SessionManager::SessionManager() { //map finished() signals from sessions _sessionMapper = new QSignalMapper(this); - connect(_sessionMapper , static_cast(&QSignalMapper::mapped) , this , - &Konsole::SessionManager::sessionTerminated); + connect(_sessionMapper , static_cast(&QSignalMapper::mapped) , this , &Konsole::SessionManager::sessionTerminated); ProfileManager* profileMananger = ProfileManager::instance(); - connect(profileMananger , &Konsole::ProfileManager::profileChanged , - this , &Konsole::SessionManager::profileChanged); + connect(profileMananger , &Konsole::ProfileManager::profileChanged , this , &Konsole::SessionManager::profileChanged); } SessionManager::~SessionManager() @@ -98,13 +96,11 @@ Session* SessionManager::createSession(Profile::Ptr profile) Q_ASSERT(session); applyProfile(session, profile, false); - connect(session , &Konsole::Session::profileChangeCommandReceived , this , - &Konsole::SessionManager::sessionProfileCommandReceived); + connect(session , &Konsole::Session::profileChangeCommandReceived , this , &Konsole::SessionManager::sessionProfileCommandReceived); //ask for notification when session dies _sessionMapper->setMapping(session, session); - connect(session , &Konsole::Session::finished , _sessionMapper , - static_cast(&QSignalMapper::map)); + connect(session , &Konsole::Session::finished , _sessionMapper , static_cast(&QSignalMapper::map)); //add session to active list _sessions << session; diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 1a4497526..74f4ec12b 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -368,10 +368,8 @@ TerminalDisplay::TerminalDisplay(QWidget* parent) // set the scroll bar's slider to occupy the whole area of the scroll bar initially setScroll(0, 0); _scrollBar->setCursor(Qt::ArrowCursor); - connect(_scrollBar, &QScrollBar::valueChanged, - this, &Konsole::TerminalDisplay::scrollBarPositionChanged); - connect(_scrollBar, &QScrollBar::sliderMoved, - this, &Konsole::TerminalDisplay::viewScrolledByUser); + connect(_scrollBar, &QScrollBar::valueChanged, this, &Konsole::TerminalDisplay::scrollBarPositionChanged); + connect(_scrollBar, &QScrollBar::sliderMoved, this, &Konsole::TerminalDisplay::viewScrolledByUser); // setup timers for blinking text _blinkTextTimer = new QTimer(this); @@ -3170,7 +3168,7 @@ void TerminalDisplay::dropEvent(QDropEvent* event) QAction* pasteAction = new QAction(i18n("&Paste Location"), this); pasteAction->setData(dropText); - connect(pasteAction, SIGNAL(triggered()), this, SLOT(dropMenuPasteActionTriggered())); + connect(pasteAction, &QAction::triggered, this, &TerminalDisplay::dropMenuPasteActionTriggered); QList additionalActions; additionalActions.append(pasteAction); @@ -3185,7 +3183,7 @@ void TerminalDisplay::dropEvent(QDropEvent* event) QAction* cdAction = new QAction(i18n("Change &Directory To"), this); dropText = QLatin1String(" cd ") + dropText + QChar('\n'); cdAction->setData(dropText); - connect(cdAction, SIGNAL(triggered()), this, SLOT(dropMenuCdActionTriggered())); + connect(cdAction, &QAction::triggered, this, &TerminalDisplay::dropMenuCdActionTriggered); additionalActions.append(cdAction); } } diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp index 0562c276c..278116365 100644 --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -262,12 +262,9 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position, ViewManage connect(_tabBar, &Konsole::ViewContainerTabBar::newTabRequest, this, static_cast(&Konsole::TabbedViewContainer::newViewRequest)); connect(_tabBar, &Konsole::ViewContainerTabBar::wheelDelta, this, &Konsole::TabbedViewContainer::wheelScrolled); connect(_tabBar, &Konsole::ViewContainerTabBar::initiateDrag, this, &Konsole::TabbedViewContainer::startTabDrag); - connect(_tabBar, &Konsole::ViewContainerTabBar::querySourceIndex, - this, &Konsole::TabbedViewContainer::querySourceIndex); - connect(_tabBar, &Konsole::ViewContainerTabBar::moveViewRequest, - this, &Konsole::TabbedViewContainer::onMoveViewRequest); - connect(_tabBar, &Konsole::ViewContainerTabBar::contextMenu, this, - &Konsole::TabbedViewContainer::openTabContextMenu); + connect(_tabBar, &Konsole::ViewContainerTabBar::querySourceIndex, this, &Konsole::TabbedViewContainer::querySourceIndex); + connect(_tabBar, &Konsole::ViewContainerTabBar::moveViewRequest, this, &Konsole::TabbedViewContainer::onMoveViewRequest); + connect(_tabBar, &Konsole::ViewContainerTabBar::contextMenu, this, &Konsole::TabbedViewContainer::openTabContextMenu); // The context menu of tab bar _contextPopupMenu = new QMenu(_tabBar); @@ -299,8 +296,7 @@ TabbedViewContainer::TabbedViewContainer(NavigationPosition position, ViewManage QMenu* profileMenu = new QMenu(_newTabButton); ProfileList* profileList = new ProfileList(false, profileMenu); profileList->syncWidgetActions(profileMenu, true); - connect(profileList, &Konsole::ProfileList::profileSelected, - this, static_cast(&Konsole::TabbedViewContainer::newViewRequest)); + connect(profileList, &Konsole::ProfileList::profileSelected, this, static_cast(&Konsole::TabbedViewContainer::newViewRequest)); setNewViewMenu(profileMenu); _closeTabButton = new QToolButton(_containerWidget); @@ -625,12 +621,9 @@ void TabbedViewContainer::addViewWidget(QWidget* view , int index) _stackWidget->updateGeometry(); ViewProperties* item = viewProperties(view); - connect(item, &Konsole::ViewProperties::titleChanged, this , - &Konsole::TabbedViewContainer::updateTitle); - connect(item, &Konsole::ViewProperties::iconChanged, this , - &Konsole::TabbedViewContainer::updateIcon); - connect(item, &Konsole::ViewProperties::activity, this , - &Konsole::TabbedViewContainer::updateActivity); + connect(item, &Konsole::ViewProperties::titleChanged, this , &Konsole::TabbedViewContainer::updateTitle); + connect(item, &Konsole::ViewProperties::iconChanged, this , &Konsole::TabbedViewContainer::updateIcon); + connect(item, &Konsole::ViewProperties::activity, this , &Konsole::TabbedViewContainer::updateActivity); _tabBar->insertTab(index , item->icon() , item->title()); diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 52a8a848f..0075cf3a5 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -88,14 +88,11 @@ ViewManager::ViewManager(QObject* parent , KActionCollection* collection) connect(_viewSplitter.data() , &Konsole::ViewSplitter::empty , this , &Konsole::ViewManager::empty); // listen for addition or removal of views from associated containers - connect(_containerSignalMapper , static_cast(&QSignalMapper::mapped) , this , - &Konsole::ViewManager::containerViewsChanged); + connect(_containerSignalMapper , static_cast(&QSignalMapper::mapped) , this , &Konsole::ViewManager::containerViewsChanged); // listen for profile changes - connect(ProfileManager::instance() , &Konsole::ProfileManager::profileChanged , this, - &Konsole::ViewManager::profileChanged); - connect(SessionManager::instance() , &Konsole::SessionManager::sessionUpdated , this, - &Konsole::ViewManager::updateViewsForSession); + connect(ProfileManager::instance() , &Konsole::ProfileManager::profileChanged , this, &Konsole::ViewManager::profileChanged); + connect(SessionManager::instance() , &Konsole::SessionManager::sessionUpdated , this, &Konsole::ViewManager::updateViewsForSession); //prepare DBus communication new WindowAdaptor(this); @@ -222,8 +219,7 @@ void ViewManager::setupActions() for (int i = 0; i < SWITCH_TO_TAB_COUNT; i++) { QAction* switchToTabAction = new QAction(i18nc("@action Shortcut entry", "Switch to Tab %1", i + 1), this); switchToTabMapper->setMapping(switchToTabAction, i); - connect(switchToTabAction, &QAction::triggered, switchToTabMapper, - static_cast(&QSignalMapper::map)); + connect(switchToTabAction, &QAction::triggered, switchToTabMapper, static_cast(&QSignalMapper::map)); collection->addAction(QString("switch-to-tab-%1").arg(i), switchToTabAction); } } @@ -489,10 +485,8 @@ SessionController* ViewManager::createController(Session* session , TerminalDisp SessionController* controller = new SessionController(session, view, this); connect(controller , &Konsole::SessionController::focused , this , &Konsole::ViewManager::controllerChanged); connect(session , &Konsole::Session::destroyed , controller , &Konsole::SessionController::deleteLater); - connect(session , &Konsole::Session::primaryScreenInUse , - controller , &Konsole::SessionController::setupPrimaryScreenSpecificActions); - connect(session , &Konsole::Session::selectionChanged , - controller , &Konsole::SessionController::selectionChanged); + connect(session , &Konsole::Session::primaryScreenInUse , controller , &Konsole::SessionController::setupPrimaryScreenSpecificActions); + connect(session , &Konsole::Session::selectionChanged , controller , &Konsole::SessionController::selectionChanged); connect(view , &Konsole::TerminalDisplay::destroyed , controller , &Konsole::SessionController::deleteLater); // if this is the first controller created then set it as the active controller @@ -604,10 +598,8 @@ ViewContainer* ViewManager::createContainer() TabbedViewContainer* tabbedContainer = new TabbedViewContainer(_navigationPosition, this, _viewSplitter); container = tabbedContainer; - connect(tabbedContainer, &TabbedViewContainer::detachTab, - this, &ViewManager::detachView); - connect(tabbedContainer, &TabbedViewContainer::closeTab, - this, &ViewManager::closeTabFromContainer); + connect(tabbedContainer, &TabbedViewContainer::detachTab, this, &ViewManager::detachView); + connect(tabbedContainer, &TabbedViewContainer::closeTab, this, &ViewManager::closeTabFromContainer); } break; case NoNavigation: @@ -630,16 +622,13 @@ ViewContainer* ViewManager::createContainer() } // connect signals and slots - connect(container , &Konsole::ViewContainer::viewAdded , _containerSignalMapper , - static_cast(&QSignalMapper::map)); - connect(container , &Konsole::ViewContainer::viewRemoved , _containerSignalMapper , - static_cast(&QSignalMapper::map)); + connect(container , &Konsole::ViewContainer::viewAdded , _containerSignalMapper , static_cast(&QSignalMapper::map)); + connect(container , &Konsole::ViewContainer::viewRemoved , _containerSignalMapper , static_cast(&QSignalMapper::map)); _containerSignalMapper->setMapping(container, container); connect(container, static_cast(&Konsole::ViewContainer::newViewRequest), this, static_cast(&Konsole::ViewManager::newViewRequest)); connect(container, static_cast(&Konsole::ViewContainer::newViewRequest), this, static_cast(&Konsole::ViewManager::newViewRequest)); - connect(container, &Konsole::ViewContainer::moveViewRequest, - this , &Konsole::ViewManager::containerMoveViewRequest); + connect(container, &Konsole::ViewContainer::moveViewRequest, this , &Konsole::ViewManager::containerMoveViewRequest); connect(container , &Konsole::ViewContainer::viewRemoved , this , &Konsole::ViewManager::viewDestroyed); connect(container , &Konsole::ViewContainer::activeViewChanged , this , &Konsole::ViewManager::viewActivated);