Commit a3ce74d4 authored by Alex Richardson's avatar Alex Richardson

Convert to Qt5 signal slot syntax

REVIEW: 117482
parent 08387037
......@@ -70,10 +70,10 @@ MainWindow* Application::newMainWindow()
{
MainWindow* window = new MainWindow();
connect(window, SIGNAL(newWindowRequest(Profile::Ptr,QString)),
this, SLOT(createWindow(Profile::Ptr,QString)));
connect(window, SIGNAL(viewDetached(Session*)),
this, SLOT(detachView(Session*)));
connect(window, &Konsole::MainWindow::newWindowRequest,
this, &Konsole::Application::createWindow);
connect(window, &Konsole::MainWindow::viewDetached,
this, &Konsole::Application::detachView);
return window;
}
......
......@@ -57,8 +57,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
{
// Kdialog buttons
setButtons(KDialog::Ok | KDialog::Cancel | KDialog::Apply);
connect(this, SIGNAL(applyClicked()), this, SLOT(saveColorScheme()));
connect(this, SIGNAL(okClicked()), this, SLOT(saveColorScheme()));
connect(this, &Konsole::ColorSchemeEditor::applyClicked, this, &Konsole::ColorSchemeEditor::saveColorScheme);
connect(this, &Konsole::ColorSchemeEditor::okClicked, this, &Konsole::ColorSchemeEditor::saveColorScheme);
// ui
_ui = new Ui::ColorSchemeEditor();
......@@ -66,18 +66,18 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
// description edit
_ui->descriptionEdit->setClearButtonEnabled(true);
connect(_ui->descriptionEdit , SIGNAL(textChanged(QString)) , this ,
SLOT(setDescription(QString)));
connect(_ui->descriptionEdit , &QLineEdit::textChanged , this ,
&Konsole::ColorSchemeEditor::setDescription);
// transparency slider
QFontMetrics metrics(font());
_ui->transparencyPercentLabel->setMinimumWidth(metrics.width("100%"));
connect(_ui->transparencySlider , SIGNAL(valueChanged(int)) , this , SLOT(setTransparencyPercentLabel(int)));
connect(_ui->transparencySlider , &QSlider::valueChanged , this , &Konsole::ColorSchemeEditor::setTransparencyPercentLabel);
// randomized background
connect(_ui->randomizedBackgroundCheck , SIGNAL(toggled(bool)) , this ,
SLOT(setRandomizedBackgroundColor(bool)));
connect(_ui->randomizedBackgroundCheck , &QCheckBox::toggled , this ,
&Konsole::ColorSchemeEditor::setRandomizedBackgroundColor);
// wallpaper stuff
QFileSystemModel *dirModel = new QFileSystemModel(this);
......@@ -90,10 +90,10 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui->wallpaperPath->setClearButtonEnabled(true);
_ui->wallpaperSelectButton->setIcon(KIcon("image-x-generic"));
connect(_ui->wallpaperSelectButton, SIGNAL(clicked()),
this, SLOT(selectWallpaper()));
connect(_ui->wallpaperPath, SIGNAL(textChanged(QString)),
this, SLOT(wallpaperPathChanged(QString)));
connect(_ui->wallpaperSelectButton, &QToolButton::clicked,
this, &Konsole::ColorSchemeEditor::selectWallpaper);
connect(_ui->wallpaperPath, &QLineEdit::textChanged,
this, &Konsole::ColorSchemeEditor::wallpaperPathChanged);
// color table
_ui->colorTable->setColumnCount(3);
......@@ -115,8 +115,8 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
_ui->colorTable->verticalHeader()->hide();
connect(_ui->colorTable , SIGNAL(itemClicked(QTableWidgetItem*)) , this ,
SLOT(editColorItem(QTableWidgetItem*)));
connect(_ui->colorTable , &QTableWidget::itemClicked , this ,
&Konsole::ColorSchemeEditor::editColorItem);
// warning label when transparency is not available
_ui->transparencyWarningWidget->setWordWrap(true);
......
......@@ -41,8 +41,8 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
_ui = new Ui::CopyInputDialog();
_ui->setupUi(mainWidget());
connect(_ui->selectAllButton, SIGNAL(clicked()), this, SLOT(selectAll()));
connect(_ui->deselectAllButton, SIGNAL(clicked()), this, SLOT(deselectAll()));
connect(_ui->selectAllButton, &QPushButton::clicked, this, &Konsole::CopyInputDialog::selectAll);
connect(_ui->deselectAllButton, &QPushButton::clicked, this, &Konsole::CopyInputDialog::deselectAll);
_ui->filterEdit->setClearButtonEnabled(true);
_ui->filterEdit->setFocus();
......@@ -57,8 +57,8 @@ CopyInputDialog::CopyInputDialog(QWidget* parent)
filterProxyModel->setSourceModel(_model);
filterProxyModel->setFilterKeyColumn(-1);
connect(_ui->filterEdit, SIGNAL(textChanged(QString)),
filterProxyModel, SLOT(setFilterFixedString(QString)));
connect(_ui->filterEdit, &QLineEdit::textChanged,
filterProxyModel, &QSortFilterProxyModel::setFilterFixedString);
_ui->sessionList->setModel(filterProxyModel);
_ui->sessionList->setColumnHidden(0, true); // Hide number column
......
......@@ -79,9 +79,9 @@ EditProfileDialog::EditProfileDialog(QWidget* aParent)
// disable the apply button , since no modification has been made
enableButtonApply(false);
connect(this, SIGNAL(applyClicked()), this, SLOT(save()));
connect(this, &Konsole::EditProfileDialog::applyClicked, this, &Konsole::EditProfileDialog::save);
connect(_delayedPreviewTimer, SIGNAL(timeout()), this, SLOT(delayedPreviewActivate()));
connect(_delayedPreviewTimer, &QTimer::timeout, this, &Konsole::EditProfileDialog::delayedPreviewActivate);
_ui = new Ui::EditProfileDialog();
_ui->setupUi(mainWidget());
......@@ -97,8 +97,8 @@ 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, SIGNAL(currentChanged(int)), this,
SLOT(preparePage(int)));
connect(_ui->tabWidget, &QTabWidget::currentChanged, this,
&Konsole::EditProfileDialog::preparePage);
createTempProfile();
}
......@@ -305,26 +305,26 @@ void EditProfileDialog::setupGeneralPage(const Profile::Ptr profile)
_ui->showTerminalSizeHintButton->setChecked(profile->showTerminalSizeHint());
// signals and slots
connect(_ui->dirSelectButton, SIGNAL(clicked()), this, SLOT(selectInitialDir()));
connect(_ui->iconSelectButton, SIGNAL(clicked()), this, SLOT(selectIcon()));
connect(_ui->startInSameDirButton, SIGNAL(toggled(bool)), this ,
SLOT(startInSameDir(bool)));
connect(_ui->profileNameEdit, SIGNAL(textChanged(QString)), this,
SLOT(profileNameChanged(QString)));
connect(_ui->initialDirEdit, SIGNAL(textChanged(QString)), this,
SLOT(initialDirChanged(QString)));
connect(_ui->commandEdit, SIGNAL(textChanged(QString)), this,
SLOT(commandChanged(QString)));
connect(_ui->environmentEditButton , SIGNAL(clicked()), this,
SLOT(showEnvironmentEditor()));
connect(_ui->terminalColumnsEntry, SIGNAL(valueChanged(int)),
this, SLOT(terminalColumnsEntryChanged(int)));
connect(_ui->terminalRowsEntry, SIGNAL(valueChanged(int)),
this, SLOT(terminalRowsEntryChanged(int)));
connect(_ui->showTerminalSizeHintButton, SIGNAL(toggled(bool)), this,
SLOT(showTerminalSizeHint(bool)));
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->terminalColumnsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::terminalColumnsEntryChanged);
connect(_ui->terminalRowsEntry, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::terminalRowsEntryChanged);
connect(_ui->showTerminalSizeHintButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::showTerminalSizeHint);
}
void EditProfileDialog::showEnvironmentEditor()
{
......@@ -354,18 +354,18 @@ void EditProfileDialog::setupTabsPage(const Profile::Ptr profile)
_ui->renameTabWidget->setTabTitleText(profile->localTabTitleFormat());
_ui->renameTabWidget->setRemoteTabTitleText(profile->remoteTabTitleFormat());
connect(_ui->renameTabWidget, SIGNAL(tabTitleFormatChanged(QString)), this,
SLOT(tabTitleFormatChanged(QString)));
connect(_ui->renameTabWidget, SIGNAL(remoteTabTitleFormatChanged(QString)), this,
SLOT(remoteTabTitleFormatChanged(QString)));
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, SIGNAL(valueChanged(int)),
this, SLOT(silenceSecondsChanged(int)));
connect(_ui->silenceSecondsSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::silenceSecondsChanged);
}
void EditProfileDialog::terminalColumnsEntryChanged(int value)
......@@ -456,19 +456,19 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->colorSchemeList->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
connect(_ui->colorSchemeList->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(colorSchemeSelected()));
connect(_ui->colorSchemeList, SIGNAL(entered(QModelIndex)), this,
SLOT(previewColorScheme(QModelIndex)));
&QItemSelectionModel::selectionChanged,
this, &Konsole::EditProfileDialog::colorSchemeSelected);
connect(_ui->colorSchemeList, &QListView::entered, this,
&Konsole::EditProfileDialog::previewColorScheme);
updateColorSchemeButtons();
connect(_ui->editColorSchemeButton, SIGNAL(clicked()), this,
SLOT(editColorScheme()));
connect(_ui->removeColorSchemeButton, SIGNAL(clicked()), this,
SLOT(removeColorScheme()));
connect(_ui->newColorSchemeButton, SIGNAL(clicked()), this,
SLOT(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();
......@@ -480,22 +480,22 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr profile)
_ui->fontPreviewLabel->setFont(profileFont);
setFontInputValue(profileFont);
connect(_ui->fontSizeInput, SIGNAL(valueChanged(double)), this,
SLOT(setFontSize(double)));
connect(_ui->selectFontButton, SIGNAL(clicked()), this,
SLOT(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, SIGNAL(toggled(bool)), this,
SLOT(setAntialiasText(bool)));
connect(_ui->antialiasTextButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::setAntialiasText);
_ui->boldIntenseButton->setChecked(profile->boldIntense());
connect(_ui->boldIntenseButton, SIGNAL(toggled(bool)), this,
SLOT(setBoldIntense(bool)));
connect(_ui->boldIntenseButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::setBoldIntense);
_ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
connect(_ui->enableMouseWheelZoomButton, SIGNAL(toggled(bool)), this,
SLOT(toggleMouseWheelZoom(bool)));
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::toggleMouseWheelZoom);
}
void EditProfileDialog::setAntialiasText(bool enable)
{
......@@ -718,8 +718,8 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
}
_colorDialog = new ColorSchemeEditor(this);
connect(_colorDialog, SIGNAL(colorSchemeSaveRequested(ColorScheme,bool)),
this, SLOT(saveColorScheme(ColorScheme,bool)));
connect(_colorDialog, &Konsole::ColorSchemeEditor::colorSchemeSaveRequested,
this, &Konsole::EditProfileDialog::saveColorScheme);
_colorDialog->setup(colors, isNewScheme);
_colorDialog->show();
......@@ -851,17 +851,17 @@ void EditProfileDialog::setupKeyboardPage(const Profile::Ptr /* profile */)
updateKeyBindingsList(true);
connect(_ui->keyBindingList->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
SLOT(keyBindingSelected()));
connect(_ui->newKeyBindingsButton, SIGNAL(clicked()), this,
SLOT(newKeyBinding()));
&QItemSelectionModel::selectionChanged,
this, &Konsole::EditProfileDialog::keyBindingSelected);
connect(_ui->newKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::newKeyBinding);
updateKeyBindingsButtons();
connect(_ui->editKeyBindingsButton, SIGNAL(clicked()), this,
SLOT(editKeyBinding()));
connect(_ui->removeKeyBindingsButton, SIGNAL(clicked()), this,
SLOT(removeKeyBinding()));
connect(_ui->editKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::editKeyBinding);
connect(_ui->removeKeyBindingsButton, &QPushButton::clicked, this,
&Konsole::EditProfileDialog::removeKeyBinding);
}
void EditProfileDialog::keyBindingSelected()
{
......@@ -983,8 +983,8 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
// setup scrollback type radio
int scrollBackType = profile->property<int>(Profile::HistoryMode);
_ui->historySizeWidget->setMode(Enum::HistoryModeEnum(scrollBackType));
connect(_ui->historySizeWidget, SIGNAL(historyModeChanged(Enum::HistoryModeEnum)),
this, SLOT(historyModeChanged(Enum::HistoryModeEnum)));
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historyModeChanged,
this, &Konsole::EditProfileDialog::historyModeChanged);
// setup scrollback line count spinner
const int historySize = profile->historySize();
......@@ -1002,8 +1002,8 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
setupRadio(pageamounts, scrollFullPage);
// signals and slots
connect(_ui->historySizeWidget, SIGNAL(historySizeChanged(int)),
this, SLOT(historySizeChanged(int)));
connect(_ui->historySizeWidget, &Konsole::HistorySizeWidget::historySizeChanged,
this, &Konsole::EditProfileDialog::historySizeChanged);
}
void EditProfileDialog::historySizeChanged(int lineCount)
......@@ -1072,20 +1072,20 @@ void EditProfileDialog::setupMousePage(const Profile::Ptr profile)
// interaction options
_ui->wordCharacterEdit->setText(profile->wordCharacters());
connect(_ui->wordCharacterEdit, SIGNAL(textChanged(QString)), this,
SLOT(wordCharactersChanged(QString)));
connect(_ui->wordCharacterEdit, &QLineEdit::textChanged, this,
&Konsole::EditProfileDialog::wordCharactersChanged);
int tripleClickMode = profile->property<int>(Profile::TripleClickMode);
_ui->tripleClickModeCombo->setCurrentIndex(tripleClickMode);
connect(_ui->tripleClickModeCombo, SIGNAL(activated(int)), this,
SLOT(TripleClickModeChanged(int)));
connect(_ui->tripleClickModeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this,
&Konsole::EditProfileDialog::TripleClickModeChanged);
_ui->openLinksByDirectClickButton->setEnabled(_ui->underlineLinksButton->isChecked());
_ui->enableMouseWheelZoomButton->setChecked(profile->mouseWheelZoomEnabled());
connect(_ui->enableMouseWheelZoomButton, SIGNAL(toggled(bool)), this,
SLOT(toggleMouseWheelZoom(bool)));
connect(_ui->enableMouseWheelZoomButton, &QCheckBox::toggled, this,
&Konsole::EditProfileDialog::toggleMouseWheelZoom);
}
void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
{
......@@ -1112,8 +1112,8 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
const int lineSpacing = profile->lineSpacing();
_ui->lineSpacingSpinner->setValue(lineSpacing);
connect(_ui->lineSpacingSpinner, SIGNAL(valueChanged(int)),
this, SLOT(lineSpacingChanged(int)));
connect(_ui->lineSpacingSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::EditProfileDialog::lineSpacingChanged);
// cursor options
if (profile->useCustomCursorColor())
......@@ -1123,20 +1123,20 @@ void EditProfileDialog::setupAdvancedPage(const Profile::Ptr profile)
_ui->customColorSelectButton->setColor(profile->customCursorColor());
connect(_ui->customCursorColorButton, SIGNAL(clicked()), this, SLOT(customCursorColor()));
connect(_ui->autoCursorColorButton, SIGNAL(clicked()), this, SLOT(autoCursorColor()));
connect(_ui->customColorSelectButton, SIGNAL(changed(QColor)),
SLOT(customCursorColorChanged(QColor)));
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);
int shape = profile->property<int>(Profile::CursorShape);
_ui->cursorShapeCombo->setCurrentIndex(shape);
connect(_ui->cursorShapeCombo, SIGNAL(activated(int)), this, SLOT(setCursorShape(int)));
connect(_ui->cursorShapeCombo, static_cast<void(KComboBox::*)(int)>(&KComboBox::activated), this, &Konsole::EditProfileDialog::setCursorShape);
// encoding options
QAction* codecAction = new KCodecAction(this);
KCodecAction* codecAction = new KCodecAction(this);
_ui->selectEncodingButton->setMenu(codecAction->menu());
connect(codecAction, SIGNAL(triggered(QTextCodec*)), this, SLOT(setDefaultCodec(QTextCodec*)));
connect(codecAction, static_cast<void(KCodecAction::*)(QTextCodec*)>(&KCodecAction::triggered), this, &Konsole::EditProfileDialog::setDefaultCodec);
_ui->characterEncodingLabel->setText(profile->defaultEncoding());
}
......@@ -1255,7 +1255,7 @@ void EditProfileDialog::showFontDialog()
if (!chooserList.isEmpty())
chooserList.at(0)->setSampleText(sampleText);
connect(dialog.data(), SIGNAL(fontSelected(QFont)), this, SLOT(fontSelected(QFont)));
connect(dialog.data(), &KFontDialog::fontSelected, this, &Konsole::EditProfileDialog::fontSelected);
if (dialog.data()->exec() == QDialog::Rejected)
fontSelected(currentFont);
......
......@@ -47,14 +47,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);
}
bool Emulation::programUsesMouse() const
......@@ -82,13 +82,13 @@ ScreenWindow* Emulation::createWindow()
ScreenWindow* window = new ScreenWindow(_currentScreen);
_windows << window;
connect(window , SIGNAL(selectionChanged()),
this , SLOT(bufferedUpdate()));
connect(window, SIGNAL(selectionChanged()),
this, SLOT(checkSelectedText()));
connect(window , &Konsole::ScreenWindow::selectionChanged,
this , &Konsole::Emulation::bufferedUpdate);
connect(window, &Konsole::ScreenWindow::selectionChanged,
this, &Konsole::Emulation::checkSelectedText);
connect(this , SIGNAL(outputChanged()),
window , SLOT(notifyOutputChanged()));
connect(this , &Konsole::Emulation::outputChanged,
window , &Konsole::ScreenWindow::notifyOutputChanged);
return window;
}
......@@ -204,15 +204,10 @@ void Emulation::sendKeyEvent(QKeyEvent* ev)
// A block of text
// Note that the text is proper unicode.
// We should do a conversion here
emit sendData(ev->text().toUtf8().constData(), ev->text().length());
emit sendData(ev->text().toLocal8Bit());
}
}
void Emulation::sendString(const char*, int)
{
// default implementation does nothing
}
void Emulation::sendMouseEvent(int /*buttons*/, int /*column*/, int /*row*/, int /*eventType*/)
{
// default implementation does nothing
......
......@@ -244,10 +244,8 @@ public slots:
* Sends a string of characters to the foreground terminal process.
*
* @param string The characters to send.
* @param length Length of @p string or if set to a negative value, @p string will
* be treated as a null-terminated string and its length will be determined automatically.
*/
virtual void sendString(const char* string, int length = -1) = 0;
virtual void sendString(const QByteArray &string) = 0;
/**
* Processes an incoming stream of characters. receiveData() decodes the incoming
......@@ -270,9 +268,8 @@ signals:
* standard input of the terminal.
*
* @param data The buffer of data ready to be sent
* @param len The length of @p data in bytes
*/
void sendData(const char* data, int len);
void sendData(const QByteArray& data);
/**
* Requests that the pty used by the terminal process
......
......@@ -475,8 +475,8 @@ QList<QAction*> UrlFilter::HotSpot::actions()
openAction->setObjectName(QLatin1String("open-action"));
copyAction->setObjectName(QLatin1String("copy-action"));
QObject::connect(openAction , SIGNAL(triggered()) , _urlObject , SLOT(activated()));
QObject::connect(copyAction , SIGNAL(triggered()) , _urlObject , SLOT(activated()));
QObject::connect(openAction , &QAction::triggered , _urlObject , &Konsole::FilterObject::activated);
QObject::connect(copyAction , &QAction::triggered , _urlObject , &Konsole::FilterObject::activated);
QList<QAction*> actions;
actions << openAction;
......
......@@ -286,7 +286,7 @@ class FilterObject : public QObject
Q_OBJECT
public:
explicit FilterObject(Filter::HotSpot* filter) : _filter(filter) {}
private slots:
public slots:
void activated();
private:
Filter::HotSpot* _filter;
......
......@@ -49,21 +49,21 @@ HistorySizeWidget::HistorySizeWidget(QWidget* parent)
// focus and select the spinner automatically when appropriate
_ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
connect(_ui->fixedSizeHistoryButton , SIGNAL(clicked()) ,
_ui->historyLineSpinner , SLOT(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, SIGNAL(buttonClicked(QAbstractButton*)),
this, SLOT(buttonClicked(QAbstractButton*)));
connect(modeGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),
this, &Konsole::HistorySizeWidget::buttonClicked);
_ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
this->setLineCount(HistorySizeWidget::DefaultLineCount);
connect(_ui->historyLineSpinner, SIGNAL(valueChanged(int)),
this, SIGNAL(historySizeChanged(int)));
connect(_ui->historyLineSpinner, static_cast<void(KIntSpinBox::*)(int)>(&KIntSpinBox::valueChanged),
this, &Konsole::HistorySizeWidget::historySizeChanged);
}
HistorySizeWidget::~HistorySizeWidget()
......
......@@ -54,7 +54,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
closeButton->setToolTip(i18nc("@info:tooltip", "Close the search bar"));
closeButton->setAutoRaise(true);
closeButton->setIcon(KIcon("dialog-close"));
connect(closeButton , SIGNAL(clicked()) , this , SIGNAL(closeClicked()));
connect(closeButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::closeClicked);
QLabel* findLabel = new QLabel(i18nc("@label:textbox", "Find:"), this);
_searchEdit = new QLineEdit(this);
......@@ -74,27 +74,27 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* aParent)
_searchTimer = new QTimer(this);
_searchTimer->setInterval(250);
_searchTimer->setSingleShot(true);
connect(_searchTimer , SIGNAL(timeout()) , this , SLOT(notifySearchChanged()));
connect(_searchEdit , SIGNAL(textChanged(QString)) , _searchTimer , SLOT(start()));
connect(_searchTimer , &QTimer::timeout , this , &Konsole::IncrementalSearchBar::notifySearchChanged);
connect(_searchEdit , &QLineEdit::textChanged , _searchTimer , static_cast<void(QTimer::*)()>(&QTimer::start));
_findNextButton = new QToolButton(this);
_findNextButton->setObjectName(QLatin1String("find-next-button"));
_findNextButton->setText(i18nc("@action:button Go to the next phrase", "Next"));
_findNextButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
_findNextButton->setToolTip(i18nc("@info:tooltip", "Find the next match for the current search phrase"));
connect(_findNextButton , SIGNAL(clicked()) , this , SIGNAL(findNextClicked()));
connect(_findNextButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::findNextClicked);
_findPreviousButton = new QToolButton(this);
_findPreviousButton->setObjectName(QLatin1String("find-previous-button"));
_findPreviousButton->setText(i18nc("@action:button Go to the previous phrase", "Previous"));
_findPreviousButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
_findPreviousButton->setToolTip(i18nc("@info:tooltip", "Find the previous match for the current search phrase"));
connect(_findPreviousButton , SIGNAL(clicked()) , this , SIGNAL(findPreviousClicked()));
connect(_findPreviousButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::findPreviousClicked);
_searchFromButton = new QToolButton(this);
_searchFromButton->setObjectName(QLatin1String("search-from-button"));
connect(_searchFromButton , SIGNAL(clicked()) , this , SIGNAL(searchFromClicked()));
connect(_searchFromButton , &QToolButton::clicked , this , &Konsole::IncrementalSearchBar::searchFromClicked);
QToolButton* optionsButton = new QToolButton(this);
optionsButton->setObjectName(QLatin1String("find-options-button"));
......@@ -120,27 +120,27 @@ 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, SIGNAL(toggled(bool)),
this, SIGNAL(matchCaseToggled(bool)));
connect(_caseSensitive, &QAction::toggled,
this, &Konsole::IncrementalSearchBar::matchCaseToggled);
_regExpression = optionsMenu->addAction(i18nc("@item:inmenu", "Match regular expression"));
_regExpression->setCheckable(true);
connect(_regExpression, SIGNAL(toggled(bool)),
this, SIGNAL(matchRegExpToggled(bool)));
connect(_regExpression, &QAction::toggled,