diff --git a/addons/backtracebrowser/katebacktracebrowser.cpp b/addons/backtracebrowser/katebacktracebrowser.cpp --- a/addons/backtracebrowser/katebacktracebrowser.cpp +++ b/addons/backtracebrowser/katebacktracebrowser.cpp @@ -41,6 +41,7 @@ #include #include #include +#include //END Includes K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin();) @@ -138,8 +139,7 @@ i18n("Backtrace Browser")); m_widget = new KateBtBrowserWidget(mainWindow, toolview); - connect(plugin, SIGNAL(newStatus(QString)), - m_widget, SLOT(setStatus(QString))); + connect(plugin, &KateBtBrowserPlugin::newStatus, m_widget, &KateBtBrowserWidget::setStatus); } KateBtBrowserPluginView::~KateBtBrowserPluginView() @@ -162,12 +162,11 @@ setupUi(this); timer.setSingleShot(true); - connect(&timer, SIGNAL(timeout()), this, SLOT(clearStatus())); - - connect(btnBacktrace, SIGNAL(clicked()), this, SLOT(loadFile())); - connect(btnClipboard, SIGNAL(clicked()), this, SLOT(loadClipboard())); - connect(btnConfigure, SIGNAL(clicked()), this, SLOT(configure())); - connect(lstBacktrace, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(itemActivated(QTreeWidgetItem *, int))); + connect(&timer, &QTimer::timeout, this, &KateBtBrowserWidget::clearStatus); + connect(btnBacktrace, &QPushButton::clicked, this, &KateBtBrowserWidget::loadFile); + connect(btnClipboard, &QPushButton::clicked, this, &KateBtBrowserWidget::loadClipboard); + connect(btnConfigure, &QPushButton::clicked, this, &KateBtBrowserWidget::configure); + connect(lstBacktrace, &QTreeWidget::itemActivated, this, &KateBtBrowserWidget::itemActivated); } KateBtBrowserWidget::~KateBtBrowserWidget() @@ -297,9 +296,9 @@ reset(); - connect(btnAdd, SIGNAL(clicked()), this, SLOT(add())); - connect(btnRemove, SIGNAL(clicked()), this, SLOT(remove())); - connect(edtExtensions, SIGNAL(textChanged(QString)), this, SLOT(textChanged())); + connect(btnAdd, &QPushButton::clicked, this, &KateBtConfigWidget::add); + connect(btnRemove, &QPushButton::clicked, this, &KateBtConfigWidget::remove); + connect(edtExtensions, &QLineEdit::textChanged, this, &KateBtConfigWidget::textChanged); m_changed = false; } @@ -405,9 +404,9 @@ layout->addWidget(m_configWidget); layout->addWidget(box); - connect(this, SIGNAL(accepted()), m_configWidget, SLOT(apply())); - connect(box, SIGNAL(accepted()), this, SLOT(accept())); - connect(box, SIGNAL(rejected()), this, SLOT(reject())); + connect(this, &KateBtConfigDialog::accepted, m_configWidget, &KateBtConfigWidget::apply); + connect(box, &QDialogButtonBox::accepted, this, &KateBtConfigDialog::accept); + connect(box, &QDialogButtonBox::rejected, this, &KateBtConfigDialog::reject); } KateBtConfigDialog::~KateBtConfigDialog() diff --git a/addons/close-except-like/close_confirm_dialog.cpp b/addons/close-except-like/close_confirm_dialog.cpp --- a/addons/close-except-like/close_confirm_dialog.cpp +++ b/addons/close-except-like/close_confirm_dialog.cpp @@ -95,10 +95,10 @@ // so not needed to read config... assert("Sanity check" && show_confirmation_action->isChecked()); m_dont_ask_again->setCheckState(Qt::Unchecked); - connect(m_dont_ask_again, SIGNAL(toggled(bool)), show_confirmation_action, SLOT(toggle())); + connect(m_dont_ask_again, &QCheckBox::toggled, show_confirmation_action, &KToggleAction::toggle); // Update documents list according checkboxes - connect(this, SIGNAL(accepted()), this, SLOT(updateDocsList())); + connect(this, &CloseConfirmDialog::accepted, this, &CloseConfirmDialog::updateDocsList); KConfigGroup gcg(KSharedConfig::openConfig(), "kate-close-except-like-CloseConfirmationDialog"); KWindowConfig::restoreWindowSize(windowHandle(),gcg); // restore dialog geometry from config diff --git a/addons/close-except-like/close_except_plugin.cpp b/addons/close-except-like/close_except_plugin.cpp --- a/addons/close-except-like/close_except_plugin.cpp +++ b/addons/close-except-like/close_except_plugin.cpp @@ -109,28 +109,15 @@ actionCollection()->addAction(QStringLiteral("file_close_except"), m_except_menu); actionCollection()->addAction(QStringLiteral("file_close_like"), m_like_menu); - // Subscribe self to document creation - connect( - KTextEditor::Editor::instance() - , SIGNAL(documentCreated(KTextEditor::Editor*, KTextEditor::Document*)) - , this - , SLOT(documentCreated(KTextEditor::Editor*, KTextEditor::Document*)) - ); + connect(KTextEditor::Editor::instance(), &KTextEditor::Editor::documentCreated, + this, &CloseExceptPluginView::documentCreated); // Configure toggle action and connect it to update state m_show_confirmation_action->setChecked(m_plugin->showConfirmationNeeded()); - connect( - m_show_confirmation_action - , SIGNAL(toggled(bool)) - , m_plugin - , SLOT(toggleShowConfirmation(bool)) - ); + connect(m_show_confirmation_action, &KToggleAction::toggled, + m_plugin, &CloseExceptPlugin::toggleShowConfirmation); // - connect( - m_mainWindow - , SIGNAL(viewCreated(KTextEditor::View*)) - , this - , SLOT(viewCreated(KTextEditor::View*)) - ); + connect(m_mainWindow, &KTextEditor::MainWindow::viewCreated, + this, &CloseExceptPluginView::viewCreated); // Fill menu w/ currently opened document masks/groups updateMenu(); @@ -157,24 +144,12 @@ void CloseExceptPluginView::connectToDocument(KTextEditor::Document* document) { // Subscribe self to document close and name changes - connect( - document - , SIGNAL(aboutToClose(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); - connect( - document - , SIGNAL(documentNameChanged(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); - connect( - document - , SIGNAL(documentUrlChanged(KTextEditor::Document*)) - , this - , SLOT(updateMenuSlotStub(KTextEditor::Document*)) - ); + connect(document, &KTextEditor::Document::aboutToClose, + this, &CloseExceptPluginView::updateMenuSlotStub); + connect(document, &KTextEditor::Document::documentNameChanged, + this, &CloseExceptPluginView::updateMenuSlotStub); + connect(document, &KTextEditor::Document::documentUrlChanged, + this, &CloseExceptPluginView::updateMenuSlotStub); } void CloseExceptPluginView::updateMenuSlotStub(KTextEditor::Document*) @@ -194,7 +169,9 @@ QString action = path.path() + QLatin1Char('*'); actions[action] = QPointer(new QAction(action, menu)); menu->addAction(actions[action]); - connect(actions[action], SIGNAL(triggered()), mapper, SLOT(map())); + //connect(actions[action], &QAction::triggered, mapper, &QSignalMapper::map); + connect(actions[action], &QAction::triggered, + mapper, static_cast(&QSignalMapper::map)); mapper->setMapping(actions[action], action); } } @@ -211,7 +188,8 @@ QString action = mask.startsWith(QLatin1Char('*')) ? mask : mask + QLatin1Char('*'); actions[action] = QPointer(new QAction(action, menu)); menu->addAction(actions[action]); - connect(actions[action], SIGNAL(triggered()), mapper, SLOT(map())); + connect(actions[action], &QAction::triggered, + mapper, static_cast(&QSignalMapper::map)); mapper->setMapping(actions[action], action); } } @@ -299,8 +277,10 @@ // m_except_mapper = updateMenu(paths, masks, m_except_actions, m_except_menu); m_like_mapper = updateMenu(paths, masks, m_like_actions, m_like_menu); - connect(m_except_mapper, SIGNAL(mapped(const QString&)), this, SLOT(closeExcept(const QString&))); - connect(m_like_mapper, SIGNAL(mapped(const QString&)), this, SLOT(closeLike(const QString&))); + connect(m_except_mapper, static_cast(&QSignalMapper::mapped), + this, &CloseExceptPluginView::closeExcept); + connect(m_like_mapper, static_cast(&QSignalMapper::mapped), + this, &CloseExceptPluginView::closeLike); } } diff --git a/addons/filebrowser/katefilebrowser.cpp b/addons/filebrowser/katefilebrowser.cpp --- a/addons/filebrowser/katefilebrowser.cpp +++ b/addons/filebrowser/katefilebrowser.cpp @@ -70,7 +70,7 @@ KFilePlacesModel* model = new KFilePlacesModel(this); m_urlNavigator = new KUrlNavigator(model, QUrl::fromLocalFile(QDir::homePath()), this); - connect(m_urlNavigator, SIGNAL(urlChanged(QUrl)), SLOT(updateDirOperator(QUrl))); + connect(m_urlNavigator, &KUrlNavigator::urlChanged, this, &KateFileBrowser::updateDirOperator); mainLayout->addWidget(m_urlNavigator); m_dirOperator = new KDirOperator(QUrl(), this); @@ -85,10 +85,10 @@ m_dirOperator->setNewFileMenuSupportedMimeTypes(filter); setFocusProxy(m_dirOperator); - connect(m_dirOperator, SIGNAL(viewChanged(QAbstractItemView*)), - this, SLOT(selectorViewChanged(QAbstractItemView*))); - connect(m_urlNavigator, SIGNAL(returnPressed()), - m_dirOperator, SLOT(setFocus())); + connect(m_dirOperator, &KDirOperator::viewChanged, this, &KateFileBrowser::selectorViewChanged); + connect(m_urlNavigator, &KUrlNavigator::returnPressed, + m_dirOperator, static_cast(&KDirOperator::setFocus)); + // now all actions exist in dir operator and we can use them in the toolbar setupActions(); setupToolbar(); @@ -99,24 +99,21 @@ m_filter->lineEdit()->setPlaceholderText(i18n("Search")); mainLayout->addWidget(m_filter); - connect(m_filter, SIGNAL(editTextChanged(QString)), - SLOT(slotFilterChange(QString))); - connect(m_filter, SIGNAL(returnPressed(QString)), - m_filter, SLOT(addToHistory(QString))); - connect(m_filter, SIGNAL(returnPressed(QString)), - m_dirOperator, SLOT(setFocus())); - - connect(m_dirOperator, SIGNAL(urlEntered(QUrl)), - this, SLOT(updateUrlNavigator(QUrl))); + connect(m_filter, &KHistoryComboBox::editTextChanged, this, &KateFileBrowser::slotFilterChange); + connect(m_filter, static_cast(&KHistoryComboBox::returnPressed), + m_filter, &KHistoryComboBox::addToHistory); + connect(m_filter, static_cast(&KHistoryComboBox::returnPressed), + m_dirOperator, static_cast< void (KDirOperator::*)()>(&KDirOperator::setFocus)); + connect(m_dirOperator, &KDirOperator::urlEntered, this, &KateFileBrowser::updateUrlNavigator); // Connect the bookmark handler - connect(m_bookmarkHandler, SIGNAL(openUrl(QString)), - this, SLOT(setDir(QString))); + connect(m_bookmarkHandler, &KateBookmarkHandler::openUrl, + this, static_cast(&KateFileBrowser::setDir)); m_filter->setWhatsThis(i18n("Enter a name filter to limit which files are displayed.")); - connect(m_dirOperator, SIGNAL(fileSelected(KFileItem)), this, SLOT(fileSelected(KFileItem))); - connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(autoSyncFolder())); + connect(m_dirOperator, &KDirOperator::fileSelected, this, &KateFileBrowser::fileSelected); + connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KateFileBrowser::autoSyncFolder); } KateFileBrowser::~KateFileBrowser() @@ -307,7 +304,7 @@ syncFolder->setShortcutContext(Qt::WidgetWithChildrenShortcut); syncFolder->setText(i18n("Current Document Folder")); syncFolder->setIcon(QIcon::fromTheme(QStringLiteral("system-switch-user"))); - connect(syncFolder, SIGNAL(triggered()), this, SLOT(setActiveDocumentDir())); + connect(syncFolder, &QAction::triggered, this, &KateFileBrowser::setActiveDocumentDir); m_actionCollection->addAction(QStringLiteral("sync_dir"), syncFolder); m_actionCollection->addAction(QStringLiteral("bookmarks"), acmBookmarks); @@ -327,7 +324,7 @@ m_autoSyncFolder->setCheckable(true); m_autoSyncFolder->setText(i18n("Automatically synchronize with current document")); m_autoSyncFolder->setIcon(QIcon::fromTheme(QStringLiteral("system-switch-user"))); - connect(m_autoSyncFolder, SIGNAL(triggered()), this, SLOT(autoSyncFolder())); + connect(m_autoSyncFolder, &QAction::triggered, this, &KateFileBrowser::autoSyncFolder); optionsMenu->addAction(m_autoSyncFolder); m_actionCollection->addAction(QStringLiteral("configure"), optionsMenu); diff --git a/addons/filebrowser/katefilebrowserconfig.cpp b/addons/filebrowser/katefilebrowserconfig.cpp --- a/addons/filebrowser/katefilebrowserconfig.cpp +++ b/addons/filebrowser/katefilebrowserconfig.cpp @@ -85,10 +85,10 @@ gbToolbar->setLayout(vbox); lo->addWidget( gbToolbar ); - connect( acSel, SIGNAL(added(QListWidgetItem*)), this, SLOT(slotMyChanged()) ); - connect( acSel, SIGNAL(removed(QListWidgetItem*)), this, SLOT(slotMyChanged()) ); - connect( acSel, SIGNAL(movedUp(QListWidgetItem*)), this, SLOT(slotMyChanged()) ); - connect( acSel, SIGNAL(movedDown(QListWidgetItem*)), this, SLOT(slotMyChanged()) ); + connect(acSel, &KActionSelector::added, this, &KateFileBrowserConfigPage::slotMyChanged); + connect(acSel, &KActionSelector::removed, this, &KateFileBrowserConfigPage::slotMyChanged); + connect(acSel, &KActionSelector::movedUp, this, &KateFileBrowserConfigPage::slotMyChanged); + connect(acSel, &KActionSelector::movedDown, this, &KateFileBrowserConfigPage::slotMyChanged); // make it look nice lo->addStretch( 1 ); diff --git a/addons/filebrowser/katefilebrowserplugin.cpp b/addons/filebrowser/katefilebrowserplugin.cpp --- a/addons/filebrowser/katefilebrowserplugin.cpp +++ b/addons/filebrowser/katefilebrowserplugin.cpp @@ -43,7 +43,7 @@ QObject *KateFileBrowserPlugin::createView (KTextEditor::MainWindow *mainWindow) { KateFileBrowserPluginView* view = new KateFileBrowserPluginView (this, mainWindow); - connect(view, SIGNAL(destroyed(QObject*)), this, SLOT(viewDestroyed(QObject*))); + connect(view, &KateFileBrowserPluginView::destroyed, this, &KateFileBrowserPlugin::viewDestroyed); m_views.append(view); return view; } diff --git a/addons/filetree/katefiletree.cpp b/addons/filetree/katefiletree.cpp --- a/addons/filetree/katefiletree.cpp +++ b/addons/filetree/katefiletree.cpp @@ -60,32 +60,32 @@ setDragDropMode(QAbstractItemView::DragOnly); // handle activated (e.g. for pressing enter) + clicked (to avoid to need to do double-click e.g. on Windows) - connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(mouseClicked(QModelIndex))); - connect(this, SIGNAL(clicked(QModelIndex)), this, SLOT(mouseClicked(QModelIndex))); - connect(this, SIGNAL(pressed(QModelIndex)), this, SLOT(mouseClicked(QModelIndex))); + connect(this, &KateFileTree::activated, this, &KateFileTree::mouseClicked); + connect(this, &KateFileTree::clicked, this, &KateFileTree::mouseClicked); + connect(this, &KateFileTree::pressed, this, &KateFileTree::mouseClicked); m_filelistReloadDocument = new QAction(QIcon::fromTheme(QLatin1String("view-refresh")), i18nc("@action:inmenu", "Reloa&d"), this); - connect(m_filelistReloadDocument, SIGNAL(triggered(bool)), SLOT(slotDocumentReload())); + connect(m_filelistReloadDocument, &QAction::triggered, this, &KateFileTree::slotDocumentReload); m_filelistReloadDocument->setWhatsThis(i18n("Reload selected document(s) from disk.")); m_filelistCloseDocument = new QAction(QIcon::fromTheme(QLatin1String("document-close")), i18nc("@action:inmenu", "Close"), this); - connect(m_filelistCloseDocument, SIGNAL(triggered()), this, SLOT(slotDocumentClose())); + connect(m_filelistCloseDocument, &QAction::triggered, this, &KateFileTree::slotDocumentClose); m_filelistCloseDocument->setWhatsThis(i18n("Close the current document.")); m_filelistExpandRecursive = new QAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18nc("@action:inmenu", "Expand recursively"), this); - connect(m_filelistExpandRecursive, SIGNAL(triggered()), this, SLOT(slotExpandRecursive())); + connect(m_filelistExpandRecursive, &QAction::triggered, this, &KateFileTree::slotExpandRecursive); m_filelistExpandRecursive->setWhatsThis(i18n("Expand the file list sub tree recursively.")); m_filelistCollapseRecursive = new QAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18nc("@action:inmenu", "Collapse recursively"), this); - connect(m_filelistCollapseRecursive, SIGNAL(triggered()), this, SLOT(slotCollapseRecursive())); + connect(m_filelistCollapseRecursive, &QAction::triggered, this, &KateFileTree::slotCollapseRecursive); m_filelistCollapseRecursive->setWhatsThis(i18n("Collapse the file list sub tree recursively.")); m_filelistCloseOtherDocument = new QAction(QIcon::fromTheme(QLatin1String("document-close")), i18nc("@action:inmenu", "Close Other"), this); - connect(m_filelistCloseOtherDocument, SIGNAL(triggered()), this, SLOT(slotDocumentCloseOther())); + connect(m_filelistCloseOtherDocument, &QAction::triggered, this, &KateFileTree::slotDocumentCloseOther); m_filelistCloseOtherDocument->setWhatsThis(i18n("Close other documents in this folder.")); m_filelistCopyFilename = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), i18nc("@action:inmenu", "Copy Filename"), this); - connect(m_filelistCopyFilename, SIGNAL(triggered()), this, SLOT(slotCopyFilename())); + connect(m_filelistCopyFilename, &QAction::triggered, this, &KateFileTree::slotCopyFilename); m_filelistCopyFilename->setWhatsThis(i18n("Copy the filename of the file.")); m_filelistRenameFile = new QAction(QIcon::fromTheme(QLatin1String("edit-rename")), i18nc("@action:inmenu", "Rename File"), this); @@ -99,7 +99,7 @@ m_filelistPrintDocumentPreview->setWhatsThis(i18n("Show print preview of current document")); m_filelistDeleteDocument = new QAction(QIcon::fromTheme(QLatin1String("edit-delete-shred")), i18nc("@action:inmenu", "Delete Document"), this); - connect(m_filelistDeleteDocument, SIGNAL(triggered()), this, SLOT(slotDocumentDelete())); + connect(m_filelistDeleteDocument, &QAction::triggered, this, &KateFileTree::slotDocumentDelete); m_filelistDeleteDocument->setWhatsThis(i18n("Close and delete selected file from storage.")); QActionGroup *modeGroup = new QActionGroup(this); @@ -127,7 +127,7 @@ SLOT(slotSortOpeningOrder()), false); m_resetHistory = new QAction(QIcon::fromTheme(QLatin1String("edit-clear-history")), i18nc("@action:inmenu", "Clear History"), this); - connect(m_resetHistory, SIGNAL(triggered()), this, SLOT(slotResetHistory())); + connect(m_resetHistory, &QAction::triggered, this, &KateFileTree::slotResetHistory); m_resetHistory->setWhatsThis(i18n("Clear edit/view history.")); QPalette p = palette(); @@ -247,8 +247,8 @@ menu.addAction(m_filelistPrintDocument); menu.addAction(m_filelistPrintDocumentPreview); QMenu *openWithMenu = menu.addMenu(i18nc("@action:inmenu", "Open With")); - connect(openWithMenu, SIGNAL(aboutToShow()), this, SLOT(slotFixOpenWithMenu())); - connect(openWithMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotOpenWithMenuAction(QAction *))); + connect(openWithMenu, &QMenu::aboutToShow, this, &KateFileTree::slotFixOpenWithMenu); + connect(openWithMenu, &QMenu::triggered, this, &KateFileTree::slotOpenWithMenuAction); const bool hasFileName = doc->url().isValid(); m_filelistCopyFilename->setEnabled(hasFileName); diff --git a/addons/filetree/katefiletreeconfigpage.cpp b/addons/filetree/katefiletreeconfigpage.cpp --- a/addons/filetree/katefiletreeconfigpage.cpp +++ b/addons/filetree/katefiletreeconfigpage.cpp @@ -125,12 +125,14 @@ reset(); - connect(gbEnableShading, SIGNAL(toggled(bool)), this, SLOT(slotMyChanged())); - connect(kcbViewShade, SIGNAL(changed(QColor)), this, SLOT(slotMyChanged())); - connect(kcbEditShade, SIGNAL(changed(QColor)), this, SLOT(slotMyChanged())); - connect(cmbSort, SIGNAL(activated(int)), this, SLOT(slotMyChanged())); - connect(cmbMode, SIGNAL(activated(int)), this, SLOT(slotMyChanged())); - connect(cbShowFullPath, SIGNAL(stateChanged(int)), this, SLOT(slotMyChanged())); + connect(gbEnableShading, &QGroupBox::toggled, this, &KateFileTreeConfigPage::slotMyChanged); + connect(kcbViewShade, &KColorButton::changed, this, &KateFileTreeConfigPage::slotMyChanged); + connect(kcbEditShade, &KColorButton::changed, this, &KateFileTreeConfigPage::slotMyChanged); + connect(cmbSort, static_cast(&KComboBox::activated), + this, &KateFileTreeConfigPage::slotMyChanged); + connect(cmbMode, static_cast(&KComboBox::activated), + this, &KateFileTreeConfigPage::slotMyChanged); + connect(cbShowFullPath, &QCheckBox::stateChanged, this, &KateFileTreeConfigPage::slotMyChanged); } QString KateFileTreeConfigPage::name() const diff --git a/addons/filetree/katefiletreemodel.cpp b/addons/filetree/katefiletreemodel.cpp --- a/addons/filetree/katefiletreemodel.cpp +++ b/addons/filetree/katefiletreemodel.cpp @@ -462,9 +462,9 @@ void KateFileTreeModel::connectDocument(const KTextEditor::Document *doc) { - connect(doc, SIGNAL(documentNameChanged(KTextEditor::Document *)), this, SLOT(documentNameChanged(KTextEditor::Document *))); - connect(doc, SIGNAL(documentUrlChanged(KTextEditor::Document *)), this, SLOT(documentNameChanged(KTextEditor::Document *))); - connect(doc, SIGNAL(modifiedChanged(KTextEditor::Document *)), this, SLOT(documentModifiedChanged(KTextEditor::Document *))); + connect(doc, &KTextEditor::Document::documentNameChanged, this, &KateFileTreeModel::documentNameChanged); + connect(doc, &KTextEditor::Document::documentUrlChanged, this, &KateFileTreeModel::documentNameChanged); + connect(doc, &KTextEditor::Document::modifiedChanged, this, &KateFileTreeModel::documentModifiedChanged); connect(doc, SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)), this, SLOT(documentModifiedOnDisc(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason))); } @@ -824,9 +824,9 @@ void KateFileTreeModel::slotAboutToDeleteDocuments(const QList &docs) { foreach(const KTextEditor::Document * doc, docs) { - disconnect(doc, SIGNAL(documentNameChanged(KTextEditor::Document *)), this, SLOT(documentNameChanged(KTextEditor::Document *))); - disconnect(doc, SIGNAL(documentUrlChanged(KTextEditor::Document *)), this, SLOT(documentNameChanged(KTextEditor::Document *))); - disconnect(doc, SIGNAL(modifiedChanged(KTextEditor::Document *)), this, SLOT(documentModifiedChanged(KTextEditor::Document *))); + disconnect(doc, &KTextEditor::Document::documentNameChanged, this, &KateFileTreeModel::documentNameChanged); + disconnect(doc, &KTextEditor::Document::documentUrlChanged, this, &KateFileTreeModel::documentNameChanged); + disconnect(doc, &KTextEditor::Document::modifiedChanged, this, &KateFileTreeModel::documentModifiedChanged); disconnect(doc, SIGNAL(modifiedOnDisk(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason)), this, SLOT(documentModifiedOnDisc(KTextEditor::Document *, bool, KTextEditor::ModificationInterface::ModifiedOnDiskReason))); } diff --git a/addons/filetree/katefiletreeplugin.cpp b/addons/filetree/katefiletreeplugin.cpp --- a/addons/filetree/katefiletreeplugin.cpp +++ b/addons/filetree/katefiletreeplugin.cpp @@ -63,7 +63,7 @@ QObject *KateFileTreePlugin::createView(KTextEditor::MainWindow *mainWindow) { KateFileTreePluginView *view = new KateFileTreePluginView(mainWindow, this); - connect(view, SIGNAL(destroyed(QObject *)), this, SLOT(viewDestroyed(QObject *))); + connect(view, &KateFileTreePluginView::destroyed, this, &KateFileTreePlugin::viewDestroyed); m_views.append(view); return view; @@ -150,11 +150,9 @@ m_fileTree->setSortingEnabled(true); mainLayout->addWidget(m_fileTree); - connect(m_fileTree, SIGNAL(activateDocument(KTextEditor::Document *)), - this, SLOT(activateDocument(KTextEditor::Document *))); - - connect(m_fileTree, SIGNAL(viewModeChanged(bool)), this, SLOT(viewModeChanged(bool))); - connect(m_fileTree, SIGNAL(sortRoleChanged(int)), this, SLOT(sortRoleChanged(int))); + connect(m_fileTree, &KateFileTree::activateDocument, this, &KateFileTreePluginView::activateDocument); + connect(m_fileTree, &KateFileTree::viewModeChanged, this, &KateFileTreePluginView::viewModeChanged); + connect(m_fileTree, &KateFileTree::sortRoleChanged, this, &KateFileTreePluginView::sortRoleChanged); m_documentModel = new KateFileTreeModel(this); m_proxyModel = new KateFileTreeProxyModel(this); @@ -166,34 +164,40 @@ m_documentModel->setViewShade(m_plug->settings().viewShade()); m_documentModel->setEditShade(m_plug->settings().editShade()); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentWillBeDeleted(KTextEditor::Document *)), - m_documentModel, SLOT(documentClosed(KTextEditor::Document *))); - - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentCreated(KTextEditor::Document *)), - this, SLOT(documentOpened(KTextEditor::Document *))); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentWillBeDeleted(KTextEditor::Document *)), - this, SLOT(documentClosed(KTextEditor::Document *))); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(aboutToCreateDocuments()), - this, SLOT(slotAboutToCreateDocuments())); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentsCreated(QList)), + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentWillBeDeleted, + m_documentModel, &KateFileTreeModel::documentClosed); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentCreated, + this, &KateFileTreePluginView::documentOpened); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentWillBeDeleted, + this, &KateFileTreePluginView::documentClosed); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::aboutToCreateDocuments, + this, &KateFileTreePluginView::slotAboutToCreateDocuments); + + connect(KTextEditor::Editor::instance()->application(), + SIGNAL(documentsCreated(QList)), this, SLOT(slotDocumentsCreated(const QList &))); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(aboutToDeleteDocuments(const QList &)), - m_documentModel, SLOT(slotAboutToDeleteDocuments(const QList &))); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentsDeleted(const QList &)), - m_documentModel, SLOT(slotDocumentsDeleted(const QList &))); - connect(m_documentModel, SIGNAL(triggerViewChangeAfterNameChange()), this, SLOT(viewChanged())); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::aboutToDeleteDocuments, + m_documentModel, &KateFileTreeModel::slotAboutToDeleteDocuments); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentsDeleted, + m_documentModel, &KateFileTreeModel::slotDocumentsDeleted); + + connect(m_documentModel, &KateFileTreeModel::triggerViewChangeAfterNameChange, [=] { + KateFileTreePluginView::viewChanged(); + }); + m_fileTree->setModel(m_proxyModel); m_fileTree->setDragEnabled(false); m_fileTree->setDragDropMode(QAbstractItemView::InternalMove); m_fileTree->setDropIndicatorShown(false); m_fileTree->setSelectionMode(QAbstractItemView::SingleSelection); - connect(m_fileTree->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), m_fileTree, SLOT(slotCurrentChanged(QModelIndex, QModelIndex))); + connect(m_fileTree->selectionModel(), &QItemSelectionModel::currentChanged, + m_fileTree, &KateFileTree::slotCurrentChanged); - connect(mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(viewChanged(KTextEditor::View *))); + connect(mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KateFileTreePluginView::viewChanged); // // actions @@ -225,18 +229,18 @@ aPrev->setText(i18n("Previous Document")); aPrev->setIcon(QIcon::fromTheme(QLatin1String("go-up"))); actionCollection()->setDefaultShortcut(aPrev, Qt::ALT + Qt::Key_Up); - connect(aPrev, SIGNAL(triggered(bool)), m_fileTree, SLOT(slotDocumentPrev())); + connect(aPrev, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentPrev); auto aNext = actionCollection()->addAction(QLatin1String("filetree_next_document")); aNext->setText(i18n("Next Document")); aNext->setIcon(QIcon::fromTheme(QLatin1String("go-down"))); actionCollection()->setDefaultShortcut(aNext, Qt::ALT + Qt::Key_Down); - connect(aNext, SIGNAL(triggered(bool)), m_fileTree, SLOT(slotDocumentNext())); + connect(aNext, &QAction::triggered, m_fileTree, &KateFileTree::slotDocumentNext); auto aShowActive = actionCollection()->addAction(QLatin1String("filetree_show_active_document")); aShowActive->setText(i18n("&Show Active")); aShowActive->setIcon(QIcon::fromTheme(QLatin1String("folder-sync"))); - connect(aShowActive, SIGNAL(triggered(bool)), this, SLOT(showActiveDocument())); + connect(aShowActive, &QAction::triggered, this, &KateFileTreePluginView::showActiveDocument); auto aSave = actionCollection()->addAction(QLatin1String("filetree_save"), this, SLOT(slotDocumentSave())); aSave->setText(i18n("Save Current Document")); diff --git a/addons/gdbplugin/advanced_settings.cpp b/addons/gdbplugin/advanced_settings.cpp --- a/addons/gdbplugin/advanced_settings.cpp +++ b/addons/gdbplugin/advanced_settings.cpp @@ -31,25 +31,25 @@ { setupUi(this); u_gdbBrowse->setIcon(QIcon::fromTheme(QStringLiteral("application-x-ms-dos-executable"))); - connect(u_gdbBrowse, SIGNAL(clicked()), this, SLOT(slotBrowseGDB())); + connect(u_gdbBrowse, &QToolButton::clicked, this, &AdvancedGDBSettings::slotBrowseGDB); u_setSoPrefix->setIcon(QIcon::fromTheme(QStringLiteral("folder"))); - connect(u_setSoPrefix, SIGNAL(clicked()), this, SLOT(slotSetSoPrefix())); + connect(u_setSoPrefix, &QToolButton::clicked, this, &AdvancedGDBSettings::slotSetSoPrefix); u_addSoSearchPath->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); u_delSoSearchPath->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); - connect(u_addSoSearchPath, SIGNAL(clicked()), this, SLOT(slotAddSoPath())); - connect(u_delSoSearchPath, SIGNAL(clicked()), this, SLOT(slotDelSoPath())); + connect(u_addSoSearchPath, &QToolButton::clicked, this, &AdvancedGDBSettings::slotAddSoPath); + connect(u_delSoSearchPath, &QToolButton::clicked, this, &AdvancedGDBSettings::slotDelSoPath); u_addSrcPath->setIcon(QIcon::fromTheme(QStringLiteral("list-add"))); u_delSrcPath->setIcon(QIcon::fromTheme(QStringLiteral("list-remove"))); - connect(u_addSrcPath, SIGNAL(clicked()), this, SLOT(slotAddSrcPath())); - connect(u_delSrcPath, SIGNAL(clicked()), this, SLOT(slotDelSrcPath())); + connect(u_addSrcPath, &QToolButton::clicked, this, &AdvancedGDBSettings::slotAddSrcPath); + connect(u_delSrcPath, &QToolButton::clicked, this, &AdvancedGDBSettings::slotDelSrcPath); - connect(u_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(u_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + connect(u_buttonBox, &QDialogButtonBox::accepted, this, &AdvancedGDBSettings::accept); + connect(u_buttonBox, &QDialogButtonBox::rejected, this, &AdvancedGDBSettings::reject); - connect(u_localRemote, SIGNAL(activated(int)), this, SLOT(slotLocalRemoteChanged())); + connect(u_localRemote, static_cast(&QComboBox::activated), this, &AdvancedGDBSettings::slotLocalRemoteChanged); } AdvancedGDBSettings::~AdvancedGDBSettings() diff --git a/addons/gdbplugin/configview.cpp b/addons/gdbplugin/configview.cpp --- a/addons/gdbplugin/configview.cpp +++ b/addons/gdbplugin/configview.cpp @@ -116,15 +116,15 @@ m_advanced = new AdvancedGDBSettings(this); m_advanced->hide(); - connect(m_targetCombo, SIGNAL(editTextChanged(QString)), this, SLOT(slotTargetEdited(QString))); - connect(m_targetCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotTargetSelected(int))); - connect(m_addTarget, SIGNAL(clicked()), this, SLOT(slotAddTarget())); - connect(m_copyTarget, SIGNAL(clicked()), this, SLOT(slotCopyTarget())); - connect(m_deleteTarget, SIGNAL(clicked()), this, SLOT(slotDeleteTarget())); - connect(m_browseExe, SIGNAL(clicked()), this, SLOT(slotBrowseExec())); - connect(m_browseDir, SIGNAL(clicked()), this, SLOT(slotBrowseDir())); - connect(m_redirectTerminal, SIGNAL(toggled(bool)), this, SIGNAL(showIO(bool))); - connect(m_advancedSettings, SIGNAL(clicked()), this, SLOT(slotAdvancedClicked())); + connect(m_targetCombo, &QComboBox::editTextChanged, this, &ConfigView::slotTargetEdited); + connect(m_targetCombo, static_cast(&QComboBox::currentIndexChanged), this, &ConfigView::slotTargetSelected); + connect(m_addTarget, &QToolButton::clicked, this, &ConfigView::slotAddTarget); + connect(m_copyTarget, &QToolButton::clicked, this, &ConfigView::slotCopyTarget); + connect(m_deleteTarget, &QToolButton::clicked, this, &ConfigView::slotDeleteTarget); + connect(m_browseExe, &QToolButton::clicked, this, &ConfigView::slotBrowseExec); + connect(m_browseDir, &QToolButton::clicked, this, &ConfigView::slotBrowseDir); + connect(m_redirectTerminal, &QCheckBox::toggled, this, &ConfigView::showIO); + connect(m_advancedSettings, &QPushButton::clicked, this, &ConfigView::slotAdvancedClicked); } ConfigView::~ConfigView() @@ -135,8 +135,8 @@ { m_targetSelectAction = actionCollection->add(QStringLiteral("targets")); m_targetSelectAction->setText(i18n("Targets")); - connect(m_targetSelectAction, SIGNAL(triggered(int)), - this, SLOT(slotTargetSelected(int))); + connect(m_targetSelectAction, static_cast(&KSelectAction::triggered), + this, &ConfigView::slotTargetSelected); } void ConfigView::readConfig(const KConfigGroup& group) diff --git a/addons/gdbplugin/debugview.cpp b/addons/gdbplugin/debugview.cpp --- a/addons/gdbplugin/debugview.cpp +++ b/addons/gdbplugin/debugview.cpp @@ -78,17 +78,17 @@ //create a process to control GDB m_debugProcess.setWorkingDirectory(m_targetConf.workDir); - connect(&m_debugProcess, SIGNAL(error(QProcess::ProcessError)), - this, SLOT(slotError())); + connect(&m_debugProcess, static_cast(&QProcess::error), + this, &DebugView::slotError); - connect(&m_debugProcess, SIGNAL(readyReadStandardError()), - this, SLOT(slotReadDebugStdErr())); + connect(&m_debugProcess, &QProcess::readyReadStandardError, + this, &DebugView::slotReadDebugStdErr); - connect(&m_debugProcess, SIGNAL(readyReadStandardOutput()), - this, SLOT(slotReadDebugStdOut())); + connect(&m_debugProcess, &QProcess::readyReadStandardOutput, + this, &DebugView::slotReadDebugStdOut); - connect(&m_debugProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(slotDebugFinished(int,QProcess::ExitStatus))); + connect(&m_debugProcess, static_cast(&QProcess::finished), + this, &DebugView::slotDebugFinished); m_debugProcess.start(m_targetConf.gdbCmd); diff --git a/addons/gdbplugin/ioview.cpp b/addons/gdbplugin/ioview.cpp --- a/addons/gdbplugin/ioview.cpp +++ b/addons/gdbplugin/ioview.cpp @@ -66,7 +66,7 @@ layout->setContentsMargins(0,0,0,0); layout->setSpacing(0); - connect(m_input, SIGNAL(returnPressed()), this, SLOT(returnPressed())); + connect(m_input, &QLineEdit::returnPressed, this, &IOView::returnPressed); createFifos(); } @@ -105,7 +105,7 @@ if (!m_stdout.open(m_stdoutFD, QIODevice::ReadWrite)) return; m_stdoutNotifier = new QSocketNotifier(m_stdoutFD, QSocketNotifier::Read, this); - connect(m_stdoutNotifier, SIGNAL(activated(int)), this, SLOT(readOutput())); + connect(m_stdoutNotifier, &QSocketNotifier::activated, this, &IOView::readOutput); m_stdoutNotifier->setEnabled(true); @@ -118,7 +118,7 @@ if (!m_stderr.open(m_stderrFD, QIODevice::ReadOnly)) return; m_stderrNotifier = new QSocketNotifier(m_stderrFD, QSocketNotifier::Read, this); - connect(m_stderrNotifier, SIGNAL(activated(int)), this, SLOT(readErrors())); + connect(m_stderrNotifier, &QSocketNotifier::activated, this, &IOView::readErrors); m_stderrNotifier->setEnabled(true); return; diff --git a/addons/gdbplugin/plugin_kategdb.cpp b/addons/gdbplugin/plugin_kategdb.cpp --- a/addons/gdbplugin/plugin_kategdb.cpp +++ b/addons/gdbplugin/plugin_kategdb.cpp @@ -110,7 +110,7 @@ // input m_inputArea = new KHistoryComboBox(true); - connect(m_inputArea, SIGNAL(returnPressed()), this, SLOT(slotSendCommand())); + connect(m_inputArea, static_cast(&KHistoryComboBox::returnPressed), this, &KatePluginGDBView::slotSendCommand); QHBoxLayout *inputLayout = new QHBoxLayout(); inputLayout->addWidget(m_inputArea, 10); inputLayout->setContentsMargins(0,0,0,0); @@ -141,11 +141,9 @@ m_stackTree->resizeColumnToContents(0); m_stackTree->resizeColumnToContents(1); m_stackTree->setAutoScroll(false); - connect(m_stackTree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - this, SLOT(stackFrameSelected())); + connect(m_stackTree, &QTreeWidget::itemActivated, this, &KatePluginGDBView::stackFrameSelected); - connect(m_threadCombo, SIGNAL(currentIndexChanged(int)), - this, SLOT(threadSelected(int))); + connect(m_threadCombo, static_cast(&QComboBox::currentIndexChanged), this, &KatePluginGDBView::threadSelected); m_localsView = new LocalsView(); @@ -159,130 +157,104 @@ m_configView = new ConfigView(nullptr, mainWin); m_ioView = new IOView(); - connect(m_configView, SIGNAL(showIO(bool)), - this, SLOT(showIO(bool))); + connect(m_configView, &ConfigView::showIO, this, &KatePluginGDBView::showIO); m_tabWidget->addTab(m_gdbPage, i18nc("Tab label", "GDB Output")); m_tabWidget->addTab(m_configView, i18nc("Tab label", "Settings")); m_debugView = new DebugView(this); - connect(m_debugView, SIGNAL(readyForInput(bool)), - this, SLOT(enableDebugActions(bool))); + connect(m_debugView, &DebugView::readyForInput, this, &KatePluginGDBView::enableDebugActions); - connect(m_debugView, SIGNAL(outputText(QString)), - this, SLOT(addOutputText(QString))); + connect(m_debugView, &DebugView::outputText, this, &KatePluginGDBView::addOutputText); - connect(m_debugView, SIGNAL(outputError(QString)), - this, SLOT(addErrorText(QString))); + connect(m_debugView, &DebugView::outputError, this, &KatePluginGDBView::addErrorText); - connect(m_debugView, SIGNAL(debugLocationChanged(QUrl,int)), - this, SLOT(slotGoTo(QUrl,int))); + connect(m_debugView, &DebugView::debugLocationChanged, this, &KatePluginGDBView::slotGoTo); - connect(m_debugView, SIGNAL(breakPointSet(QUrl,int)), - this, SLOT(slotBreakpointSet(QUrl,int))); + connect(m_debugView, &DebugView::breakPointSet, this, &KatePluginGDBView::slotBreakpointSet); - connect(m_debugView, SIGNAL(breakPointCleared(QUrl,int)), - this, SLOT(slotBreakpointCleared(QUrl,int))); + connect(m_debugView, &DebugView::breakPointCleared, this, &KatePluginGDBView::slotBreakpointCleared); - connect(m_debugView, SIGNAL(clearBreakpointMarks()), - this, SLOT(clearMarks())); + connect(m_debugView, &DebugView::clearBreakpointMarks, this, &KatePluginGDBView::clearMarks); - connect(m_debugView, SIGNAL(programEnded()), - this, SLOT(programEnded())); + connect(m_debugView, &DebugView::programEnded, this, &KatePluginGDBView::programEnded); - connect(m_debugView, SIGNAL(gdbEnded()), - this, SLOT(programEnded())); + connect(m_debugView, &DebugView::gdbEnded, this, &KatePluginGDBView::programEnded); - connect(m_debugView, SIGNAL(gdbEnded()), - this, SLOT(gdbEnded())); + connect(m_debugView, &DebugView::gdbEnded, this, &KatePluginGDBView::gdbEnded); - connect(m_debugView, SIGNAL(stackFrameInfo(QString,QString)), - this, SLOT(insertStackFrame(QString,QString))); + connect(m_debugView, &DebugView::stackFrameInfo, this, &KatePluginGDBView::insertStackFrame); - connect(m_debugView, SIGNAL(stackFrameChanged(int)), - this, SLOT(stackFrameChanged(int))); + connect(m_debugView, &DebugView::stackFrameChanged, this, &KatePluginGDBView::stackFrameChanged); - connect(m_debugView, SIGNAL(infoLocal(QString)), - m_localsView, SLOT(addLocal(QString))); + connect(m_debugView, &DebugView::infoLocal, m_localsView, &LocalsView::addLocal); - connect(m_debugView, SIGNAL(threadInfo(int,bool)), - this, SLOT(insertThread(int,bool))); + connect(m_debugView, &DebugView::threadInfo, this, &KatePluginGDBView::insertThread); - connect(m_localsView, SIGNAL(localsVisible(bool)), - m_debugView, SLOT(slotQueryLocals(bool))); + connect(m_localsView, &LocalsView::localsVisible, m_debugView, &DebugView::slotQueryLocals); // Actions m_configView->registerActions(actionCollection()); QAction* a = actionCollection()->addAction(QStringLiteral("debug")); a->setText(i18n("Start Debugging")); a->setIcon(QIcon(QStringLiteral(":/kategdb/22-actions-debug-kategdb.png"))); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotDebug())); + connect(a, &QAction::triggered, this, &KatePluginGDBView::slotDebug); a = actionCollection()->addAction(QStringLiteral("kill")); a->setText(i18n("Kill / Stop Debugging")); a->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-stop"))); - connect( a, SIGNAL(triggered(bool)), - m_debugView, SLOT(slotKill())); + connect(a, &QAction::triggered, m_debugView, &DebugView::slotKill); a = actionCollection()->addAction(QStringLiteral("rerun")); a->setText(i18n("Restart Debugging")); a->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh"))); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotRestart())); + connect(a, &QAction::triggered,this, &KatePluginGDBView::slotRestart); a = actionCollection()->addAction(QStringLiteral("toggle_breakpoint")); a->setText(i18n("Toggle Breakpoint / Break")); a->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-pause"))); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotToggleBreakpoint())); + connect(a, &QAction::triggered,this, &KatePluginGDBView::slotToggleBreakpoint); a = actionCollection()->addAction(QStringLiteral("step_in")); a->setText(i18n("Step In")); a->setIcon(QIcon::fromTheme(QStringLiteral("debug-step-into"))); - connect( a, SIGNAL(triggered(bool)), - m_debugView, SLOT(slotStepInto())); + connect(a, &QAction::triggered, m_debugView, &DebugView::slotStepInto); a = actionCollection()->addAction(QStringLiteral("step_over")); a->setText(i18n("Step Over")); a->setIcon(QIcon::fromTheme(QStringLiteral("debug-step-over"))); - connect( a, SIGNAL(triggered(bool)), - m_debugView, SLOT(slotStepOver())); + connect(a, &QAction::triggered, m_debugView, &DebugView::slotStepOver); + a = actionCollection()->addAction(QStringLiteral("step_out")); a->setText(i18n("Step Out")); a->setIcon(QIcon::fromTheme(QStringLiteral("debug-step-out"))); - connect( a, SIGNAL(triggered(bool)), - m_debugView, SLOT(slotStepOut())); + connect(a, &QAction::triggered, m_debugView, &DebugView::slotStepOut); a = actionCollection()->addAction(QStringLiteral("move_pc")); a->setText(i18nc("Move Program Counter (next execution)", "Move PC")); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotMovePC())); + connect(a, &QAction::triggered, this, &KatePluginGDBView::slotMovePC); a = actionCollection()->addAction(QStringLiteral("run_to_cursor")); a->setText(i18n("Run To Cursor")); a->setIcon(QIcon::fromTheme(QStringLiteral("debug-run-cursor"))); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotRunToCursor())); + connect(a, &QAction::triggered, this, &KatePluginGDBView::slotRunToCursor); a = actionCollection()->addAction(QStringLiteral("continue")); a->setText(i18n("Continue")); a->setIcon(QIcon::fromTheme(QStringLiteral("media-playback-start"))); - connect( a, SIGNAL(triggered(bool)), - m_debugView, SLOT(slotContinue())); + connect(a, &QAction::triggered, m_debugView, &DebugView::slotContinue); a = actionCollection()->addAction(QStringLiteral("print_value")); a->setText(i18n("Print Value")); a->setIcon(QIcon::fromTheme(QStringLiteral("document-preview"))); - connect( a, SIGNAL(triggered(bool)), - this, SLOT(slotValue())); + connect(a, &QAction::triggered, this, &KatePluginGDBView::slotValue); // popup context m_menu m_menu = new KActionMenu(i18n("Debug"), this); actionCollection()->addAction(QStringLiteral("popup_gdb"), m_menu); - connect(m_menu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu())); + connect(m_menu->menu(), &QMenu::aboutToShow, this, &KatePluginGDBView::aboutToShowMenu); m_breakpoint = m_menu->menu()->addAction(i18n("popup_breakpoint"), this, SLOT(slotToggleBreakpoint())); @@ -296,8 +268,8 @@ enableDebugActions(false); - connect(m_mainWin, SIGNAL(unhandledShortcutOverride(QEvent*)), - this, SLOT(handleEsc(QEvent*))); + connect(m_mainWin, &KTextEditor::MainWindow::unhandledShortcutOverride, + this, &KatePluginGDBView::handleEsc); m_toolView->installEventFilter(this); @@ -323,15 +295,15 @@ void KatePluginGDBView::slotDebug() { - disconnect(m_ioView, SIGNAL(stdOutText(QString)), nullptr, nullptr); - disconnect(m_ioView, SIGNAL(stdErrText(QString)), nullptr, nullptr); + disconnect(m_ioView, &IOView::stdOutText, nullptr, nullptr); + disconnect(m_ioView, &IOView::stdErrText, nullptr, nullptr); if (m_configView->showIOTab()) { - connect(m_ioView, SIGNAL(stdOutText(QString)), m_ioView, SLOT(addStdOutText(QString))); - connect(m_ioView, SIGNAL(stdErrText(QString)), m_ioView, SLOT(addStdErrText(QString))); + connect(m_ioView, &IOView::stdOutText, m_ioView, &IOView::addStdOutText); + connect(m_ioView, &IOView::stdErrText, m_ioView, &IOView::addStdErrText); } else { - connect(m_ioView, SIGNAL(stdOutText(QString)), this, SLOT(addOutputText(QString))); - connect(m_ioView, SIGNAL(stdErrText(QString)), this, SLOT(addErrorText(QString))); + connect(m_ioView, &IOView::stdOutText, this, &KatePluginGDBView::addOutputText); + connect(m_ioView, &IOView::stdErrText, this, &KatePluginGDBView::addErrorText); } QStringList ioFifos; ioFifos << m_ioView->stdinFifo(); diff --git a/addons/kate-ctags/kate_ctags_plugin.cpp b/addons/kate-ctags/kate_ctags_plugin.cpp --- a/addons/kate-ctags/kate_ctags_plugin.cpp +++ b/addons/kate-ctags/kate_ctags_plugin.cpp @@ -88,12 +88,12 @@ m_confUi.updateDB->setToolTip(i18n("(Re-)generate the common CTags database.")); m_confUi.updateDB->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh"))); - connect(m_confUi.updateDB, SIGNAL(clicked()), this, SLOT(updateGlobalDB())); - connect(m_confUi.addButton, SIGNAL(clicked()), this, SLOT(addGlobalTagTarget())); - connect(m_confUi.delButton, SIGNAL(clicked()), this, SLOT(delGlobalTagTarget())); + connect(m_confUi.updateDB, &QPushButton::clicked, this, &KateCTagsConfigPage::updateGlobalDB); + connect(m_confUi.addButton, &QPushButton::clicked, this, &KateCTagsConfigPage::addGlobalTagTarget); + connect(m_confUi.delButton, &QPushButton::clicked, this, &KateCTagsConfigPage::delGlobalTagTarget); - connect(&m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(updateDone(int,QProcess::ExitStatus))); + connect(&m_proc, static_cast(&QProcess::finished), + this, &KateCTagsConfigPage::updateDone); reset(); } diff --git a/addons/kate-ctags/kate_ctags_view.cpp b/addons/kate-ctags/kate_ctags_view.cpp --- a/addons/kate-ctags/kate_ctags_view.cpp +++ b/addons/kate-ctags/kate_ctags_view.cpp @@ -51,19 +51,19 @@ QAction *back = actionCollection()->addAction(QLatin1String("ctags_return_step")); back->setText(i18n("Jump back one step")); - connect(back, SIGNAL(triggered(bool)), this, SLOT(stepBack())); + connect(back, &QAction::triggered, this, &KateCTagsView::stepBack); QAction *decl = actionCollection()->addAction(QLatin1String("ctags_lookup_current_as_declaration")); decl->setText(i18n("Go to Declaration")); - connect(decl, SIGNAL(triggered(bool)), this, SLOT(gotoDeclaration())); + connect(decl, &QAction::triggered, this, &KateCTagsView::gotoDeclaration); QAction *defin = actionCollection()->addAction(QLatin1String("ctags_lookup_current_as_definition")); defin->setText(i18n("Go to Definition")); - connect(defin, SIGNAL(triggered(bool)), this, SLOT(gotoDefinition())); + connect(defin, &QAction::triggered, this, &KateCTagsView::gotoDefinition); QAction *lookup = actionCollection()->addAction(QLatin1String("ctags_lookup_current")); lookup->setText(i18n("Lookup Current Text")); - connect(lookup, SIGNAL(triggered(bool)), this, SLOT(lookupTag())); + connect(lookup, &QAction::triggered, this, &KateCTagsView::lookupTag); // popup menu m_menu = new KActionMenu(i18n("CTags"), this); @@ -73,7 +73,7 @@ m_gotoDef=m_menu->menu()->addAction(i18n("Go to Definition: %1",QString()), this, SLOT(gotoDefinition())); m_lookup=m_menu->menu()->addAction(i18n("Lookup: %1",QString()), this, SLOT(lookupTag())); - connect(m_menu->menu(), SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); + connect(m_menu->menu(), &QMenu::aboutToShow, this, &KateCTagsView::aboutToShow); QWidget *ctagsWidget = new QWidget(m_toolView); m_ctagsUi.setupUi(ctagsWidget); @@ -96,24 +96,22 @@ m_ctagsUi.tagsFile->setToolTip(i18n("Select new or existing database file.")); m_ctagsUi.tagsFile->setMode(KFile::File); - connect(m_ctagsUi.resetCMD, SIGNAL(clicked()), this, SLOT(resetCMD())); - connect(m_ctagsUi.addButton, SIGNAL(clicked()), this, SLOT(addTagTarget())); - connect(m_ctagsUi.delButton, SIGNAL(clicked()), this, SLOT(delTagTarget())); - connect(m_ctagsUi.updateButton, SIGNAL(clicked()), this, SLOT(updateSessionDB())); - connect(m_ctagsUi.updateButton2, SIGNAL(clicked()), this, SLOT(updateSessionDB())); - connect(&m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(updateDone(int,QProcess::ExitStatus))); + connect(m_ctagsUi.resetCMD, &QToolButton::clicked, this, &KateCTagsView::resetCMD); + connect(m_ctagsUi.addButton, &QPushButton::clicked, this, &KateCTagsView::addTagTarget); + connect(m_ctagsUi.delButton, &QPushButton::clicked, this, &KateCTagsView::delTagTarget); + connect(m_ctagsUi.updateButton, &QPushButton::clicked, this, &KateCTagsView::updateSessionDB); + connect(m_ctagsUi.updateButton2, &QPushButton::clicked, this, &KateCTagsView::updateSessionDB); + connect(&m_proc, static_cast(&QProcess::finished), + this, &KateCTagsView::updateDone); - connect(m_ctagsUi.inputEdit, SIGNAL(textChanged(QString)), this, SLOT(startEditTmr())); + connect(m_ctagsUi.inputEdit, &QLineEdit::textChanged, this, &KateCTagsView::startEditTmr); m_editTimer.setSingleShot(true); - connect(&m_editTimer, SIGNAL(timeout()), this, SLOT(editLookUp())); + connect(&m_editTimer, &QTimer::timeout, this, &KateCTagsView::editLookUp); - connect(m_ctagsUi.tagTreeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), - SLOT(tagHitClicked(QTreeWidgetItem*))); + connect(m_ctagsUi.tagTreeWidget, &QTreeWidget::itemActivated, this, &KateCTagsView::tagHitClicked); - connect(m_mWin, SIGNAL(unhandledShortcutOverride(QEvent*)), - this, SLOT(handleEsc(QEvent*))); + connect(m_mWin, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateCTagsView::handleEsc); m_toolView->installEventFilter(this); diff --git a/addons/katebuild-plugin/SelectTargetView.cpp b/addons/katebuild-plugin/SelectTargetView.cpp --- a/addons/katebuild-plugin/SelectTargetView.cpp +++ b/addons/katebuild-plugin/SelectTargetView.cpp @@ -84,8 +84,8 @@ setFocusProxy(u_filterEdit); - connect(u_filterEdit, SIGNAL(textChanged(QString)), this, SLOT(setFilter(QString))); - connect(u_treeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept())); + connect(u_filterEdit, &QLineEdit::textChanged, this, &SelectTargetView::setFilter); + connect(u_treeView, &QTreeView::doubleClicked, this, &SelectTargetView::accept); u_filterEdit->installEventFilter(this); } diff --git a/addons/katebuild-plugin/TargetHtmlDelegate.cpp b/addons/katebuild-plugin/TargetHtmlDelegate.cpp --- a/addons/katebuild-plugin/TargetHtmlDelegate.cpp +++ b/addons/katebuild-plugin/TargetHtmlDelegate.cpp @@ -39,8 +39,7 @@ TargetHtmlDelegate::TargetHtmlDelegate( QObject* parent ) : QStyledItemDelegate(parent), m_isEditing(false) { - connect(this, SIGNAL(sendEditStart()), - this, SLOT(editStarted())); + connect(this, &TargetHtmlDelegate::sendEditStart, this, &TargetHtmlDelegate::editStarted); } TargetHtmlDelegate::~TargetHtmlDelegate() {} @@ -133,7 +132,7 @@ } editor->setAutoFillBackground(true); emit sendEditStart(); - connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(editEnded())); + connect(editor, &QWidget::destroyed, this, &TargetHtmlDelegate::editEnded); return editor; } diff --git a/addons/katebuild-plugin/UrlInserter.cpp b/addons/katebuild-plugin/UrlInserter.cpp --- a/addons/katebuild-plugin/UrlInserter.cpp +++ b/addons/katebuild-plugin/UrlInserter.cpp @@ -48,7 +48,7 @@ layout->addWidget(m_lineEdit); layout->addWidget(m_toolButton); setFocusProxy(m_lineEdit); - connect(m_toolButton, SIGNAL(clicked(bool)), this, SLOT(insertFolder())); + connect(m_toolButton, &QToolButton::clicked, this, &UrlInserter::insertFolder); } diff --git a/addons/katebuild-plugin/plugin_katebuild.cpp b/addons/katebuild-plugin/plugin_katebuild.cpp --- a/addons/katebuild-plugin/plugin_katebuild.cpp +++ b/addons/katebuild-plugin/plugin_katebuild.cpp @@ -107,32 +107,31 @@ QAction *a = actionCollection()->addAction(QStringLiteral("select_target")); a->setText(i18n("Select Target...")); a->setIcon(QIcon::fromTheme(QStringLiteral("select"))); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotSelectTarget())); - + connect(a, &QAction::triggered, this, &KateBuildView::slotSelectTarget); a = actionCollection()->addAction(QStringLiteral("build_default_target")); a->setText(i18n("Build Default Target")); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotBuildDefaultTarget())); + connect(a, &QAction::triggered, this, &KateBuildView::slotBuildDefaultTarget); a = actionCollection()->addAction(QStringLiteral("build_previous_target")); a->setText(i18n("Build Previous Target")); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotBuildPreviousTarget())); + connect(a, &QAction::triggered, this, &KateBuildView::slotBuildPreviousTarget); a = actionCollection()->addAction(QStringLiteral("stop")); a->setText(i18n("Stop")); a->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete"))); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotStop())); + connect(a, &QAction::triggered, this, &KateBuildView::slotStop); a = actionCollection()->addAction(QStringLiteral("goto_next")); a->setText(i18n("Next Error")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-next"))); actionCollection()->setDefaultShortcut(a, Qt::SHIFT+Qt::ALT+Qt::Key_Right); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotNext())); + connect(a, &QAction::triggered, this, &KateBuildView::slotNext); a = actionCollection()->addAction(QStringLiteral("goto_prev")); a->setText(i18n("Previous Error")); a->setIcon(QIcon::fromTheme(QStringLiteral("go-previous"))); actionCollection()->setDefaultShortcut(a, Qt::SHIFT+Qt::ALT+Qt::Key_Left); - connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrev())); + connect(a, &QAction::triggered, this, &KateBuildView::slotPrev); m_buildWidget = new QWidget(m_toolView); @@ -153,45 +152,44 @@ m_buildUi.cancelBuildButton->setEnabled(false); m_buildUi.cancelBuildButton2->setEnabled(false); - connect(m_buildUi.errTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), - SLOT(slotErrorSelected(QTreeWidgetItem*))); + connect(m_buildUi.errTreeWidget, &QTreeWidget::itemClicked, + this, &KateBuildView::slotErrorSelected); m_buildUi.plainTextEdit->setReadOnly(true); slotDisplayMode(FullOutput); - connect(m_buildUi.displayModeSlider, SIGNAL(valueChanged(int)), this, SLOT(slotDisplayMode(int))); + connect(m_buildUi.displayModeSlider, &QSlider::valueChanged, this, &KateBuildView::slotDisplayMode); - connect(m_buildUi.buildAgainButton, SIGNAL(clicked()), this, SLOT(slotBuildPreviousTarget())); - connect(m_buildUi.cancelBuildButton, SIGNAL(clicked()), this, SLOT(slotStop())); - connect(m_buildUi.buildAgainButton2, SIGNAL(clicked()), this, SLOT(slotBuildPreviousTarget())); - connect(m_buildUi.cancelBuildButton2, SIGNAL(clicked()), this, SLOT(slotStop())); + connect(m_buildUi.buildAgainButton, &QPushButton::clicked, this, &KateBuildView::slotBuildPreviousTarget); + connect(m_buildUi.cancelBuildButton, &QPushButton::clicked, this, &KateBuildView::slotStop); + connect(m_buildUi.buildAgainButton2, &QPushButton::clicked, this, &KateBuildView::slotBuildPreviousTarget); + connect(m_buildUi.cancelBuildButton2, &QPushButton::clicked, this, &KateBuildView::slotStop); - connect(m_targetsUi->newTarget, SIGNAL(clicked()), this, SLOT(targetSetNew())); - connect(m_targetsUi->copyTarget, SIGNAL(clicked()), this, SLOT(targetOrSetCopy())); - connect(m_targetsUi->deleteTarget, SIGNAL(clicked()), this, SLOT(targetDelete())); + connect(m_targetsUi->newTarget, &QToolButton::clicked, this, &KateBuildView::targetSetNew); + connect(m_targetsUi->copyTarget, &QToolButton::clicked, this, &KateBuildView::targetOrSetCopy); + connect(m_targetsUi->deleteTarget, &QToolButton::clicked, this, &KateBuildView::targetDelete); - connect(m_targetsUi->addButton, SIGNAL(clicked()), this, SLOT(slotAddTargetClicked())); - connect(m_targetsUi->buildButton, SIGNAL(clicked()), this, SLOT(slotBuildActiveTarget())); - connect(m_targetsUi, SIGNAL(enterPressed()), this, SLOT(slotBuildActiveTarget())); + connect(m_targetsUi->addButton, &QToolButton::clicked, this, &KateBuildView::slotAddTargetClicked); + connect(m_targetsUi->buildButton, &QToolButton::clicked, this, &KateBuildView::slotBuildActiveTarget); + connect(m_targetsUi, &TargetsUi::enterPressed, this, &KateBuildView::slotBuildActiveTarget); m_proc.setOutputChannelMode(KProcess::SeparateChannels); - connect(&m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotProcExited(int,QProcess::ExitStatus))); - connect(&m_proc, SIGNAL(readyReadStandardError()),this, SLOT(slotReadReadyStdErr())); - connect(&m_proc, SIGNAL(readyReadStandardOutput()),this, SLOT(slotReadReadyStdOut())); + connect(&m_proc, static_cast(&QProcess::finished), this, &KateBuildView::slotProcExited); + connect(&m_proc, &KProcess::readyReadStandardError, this, &KateBuildView::slotReadReadyStdErr); + connect(&m_proc, &KProcess::readyReadStandardOutput, this, &KateBuildView::slotReadReadyStdOut); - connect(m_win, SIGNAL(unhandledShortcutOverride(QEvent*)), this, SLOT(handleEsc(QEvent*))); + connect(m_win, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KateBuildView::handleEsc); m_toolView->installEventFilter(this); m_win->guiFactory()->addClient(this); // watch for project plugin view creation/deletion - connect(m_win, SIGNAL(pluginViewCreated (const QString &, QObject *)) - , this, SLOT(slotPluginViewCreated (const QString &, QObject *))); - - connect(m_win, SIGNAL(pluginViewDeleted (const QString &, QObject *)) - , this, SLOT(slotPluginViewDeleted (const QString &, QObject *))); + connect(m_win, &KTextEditor::MainWindow::pluginViewCreated, + this, &KateBuildView::slotPluginViewCreated); + connect(m_win, &KTextEditor::MainWindow::pluginViewDeleted, + this, &KateBuildView::slotPluginViewDeleted); // update once project plugin state manually m_projectPluginView = m_win->pluginView (QStringLiteral("kateprojectplugin")); slotProjectMapChanged (); @@ -916,7 +914,7 @@ if (name == QLatin1String("kateprojectplugin")) { m_projectPluginView = pluginView; slotProjectMapChanged (); - connect (pluginView, SIGNAL(projectMapChanged()), this, SLOT(slotProjectMapChanged())); + connect(pluginView, SIGNAL(projectMapChanged()), this, SLOT(slotProjectMapChanged())); } } diff --git a/addons/katebuild-plugin/targets.cpp b/addons/katebuild-plugin/targets.cpp --- a/addons/katebuild-plugin/targets.cpp +++ b/addons/katebuild-plugin/targets.cpp @@ -79,8 +79,9 @@ layout->addLayout(tLayout); layout->addWidget(targetsView); - connect(targetCombo, SIGNAL(activated(int)), this, SLOT(targetSetSelected(int))); - connect(targetsView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(targetActivated(QModelIndex))); + connect(targetCombo, static_cast(&QComboBox::activated), this, &TargetsUi::targetSetSelected); + connect(targetsView->selectionModel(), &QItemSelectionModel::currentChanged, + this, &TargetsUi::targetActivated); //connect(targetsView, SIGNAL(clicked(QModelIndex)), this, SLOT(targetActivated(QModelIndex))); targetsView->installEventFilter(this); diff --git a/addons/katesql/dataoutputview.cpp b/addons/katesql/dataoutputview.cpp --- a/addons/katesql/dataoutputview.cpp +++ b/addons/katesql/dataoutputview.cpp @@ -28,7 +28,8 @@ { setContextMenuPolicy(Qt::CustomContextMenu); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContextMenuRequested(QPoint))); + connect(this, &DataOutputView::customContextMenuRequested, + this, &DataOutputView::slotCustomContextMenuRequested); } void DataOutputView::slotCustomContextMenuRequested(const QPoint &pos) diff --git a/addons/katesql/dataoutputwidget.cpp b/addons/katesql/dataoutputwidget.cpp --- a/addons/katesql/dataoutputwidget.cpp +++ b/addons/katesql/dataoutputwidget.cpp @@ -68,31 +68,31 @@ action = new QAction( QIcon::fromTheme(QLatin1String("distribute-horizontal-x")), i18nc("@action:intoolbar", "Resize columns to contents"), this); toolbar->addAction(action); - connect(action, SIGNAL(triggered()), this, SLOT(resizeColumnsToContents())); + connect(action, &QAction::triggered, this, &DataOutputWidget::resizeColumnsToContents); action = new QAction( QIcon::fromTheme(QLatin1String("distribute-vertical-y")), i18nc("@action:intoolbar", "Resize rows to contents"), this); toolbar->addAction(action); - connect(action, SIGNAL(triggered()), this, SLOT(resizeRowsToContents())); + connect(action, &QAction::triggered, this, &DataOutputWidget::resizeRowsToContents); action = new QAction( QIcon::fromTheme(QLatin1String("edit-copy")), i18nc("@action:intoolbar", "Copy"), this); toolbar->addAction(action); m_view->addAction(action); - connect(action, SIGNAL(triggered()), this, SLOT(slotCopySelected())); + connect(action, &QAction::triggered, this, &DataOutputWidget::slotCopySelected); action = new QAction( QIcon::fromTheme(QLatin1String("document-export-table")), i18nc("@action:intoolbar", "Export..."), this); toolbar->addAction(action); m_view->addAction(action); - connect(action, SIGNAL(triggered()), this, SLOT(slotExport())); + connect(action, &QAction::triggered, this, &DataOutputWidget::slotExport); action = new QAction( QIcon::fromTheme(QLatin1String("edit-clear")), i18nc("@action:intoolbar", "Clear"), this); toolbar->addAction(action); - connect(action, SIGNAL(triggered()), this, SLOT(clearResults())); + connect(action, &QAction::triggered, this, &DataOutputWidget::clearResults); toolbar->addSeparator(); KToggleAction *toggleAction = new KToggleAction( QIcon::fromTheme(QLatin1String("applications-education-language")), i18nc("@action:intoolbar", "Use system locale"), this); toolbar->addAction(toggleAction); - connect(toggleAction, SIGNAL(triggered()), this, SLOT(slotToggleLocale())); + connect(action, &QAction::triggered, this, &DataOutputWidget::slotToggleLocale); m_dataLayout->addWidget(m_view); diff --git a/addons/katesql/exportwizard.cpp b/addons/katesql/exportwizard.cpp --- a/addons/katesql/exportwizard.cpp +++ b/addons/katesql/exportwizard.cpp @@ -82,7 +82,7 @@ registerField(QLatin1String("outFile"), fileRadioButton); registerField(QLatin1String("outFileUrl"), fileUrl, "text"); - connect(fileRadioButton, SIGNAL(toggled(bool)), fileUrl, SLOT(setEnabled(bool))); + connect(fileRadioButton, &QRadioButton::toggled, fileUrl, &KUrlRequester::setEnabled); } @@ -173,8 +173,8 @@ registerField(QLatin1String("quoteNumbersChar"), quoteNumbersLine); registerField(QLatin1String("fieldDelimiter*"), fieldDelimiterLine); - connect(quoteStringsCheckBox, SIGNAL(toggled(bool)), quoteStringsLine, SLOT(setEnabled(bool))); - connect(quoteNumbersCheckBox, SIGNAL(toggled(bool)), quoteNumbersLine, SLOT(setEnabled(bool))); + connect(quoteStringsCheckBox, &QCheckBox::toggled, quoteStringsLine, &KLineEdit::setEnabled); + connect(quoteNumbersCheckBox, &QCheckBox::toggled, quoteNumbersLine, &KLineEdit::setEnabled); } diff --git a/addons/katesql/katesqlconfigpage.cpp b/addons/katesql/katesqlconfigpage.cpp --- a/addons/katesql/katesqlconfigpage.cpp +++ b/addons/katesql/katesqlconfigpage.cpp @@ -48,8 +48,8 @@ reset(); - connect(m_box, SIGNAL(stateChanged(int)), this, SIGNAL(changed())); - connect(m_outputStyleWidget, SIGNAL(changed()), this, SIGNAL(changed())); + connect(m_box, &QCheckBox::stateChanged, this, &KateSQLConfigPage::changed); + connect(m_outputStyleWidget, &OutputStyleWidget::changed, this, &KateSQLConfigPage::changed); } diff --git a/addons/katesql/katesqlplugin.cpp b/addons/katesql/katesqlplugin.cpp --- a/addons/katesql/katesqlplugin.cpp +++ b/addons/katesql/katesqlplugin.cpp @@ -46,7 +46,7 @@ { KateSQLView *view = new KateSQLView(this, mainWindow); - connect(this, SIGNAL(globalSettingsChanged()), view, SLOT(slotGlobalSettingsChanged())); + connect(this, &KateSQLPlugin::globalSettingsChanged, view, &KateSQLView::slotGlobalSettingsChanged); return view; } @@ -58,8 +58,7 @@ return nullptr; KateSQLConfigPage *page = new KateSQLConfigPage(parent); - - connect(page, SIGNAL(settingsChanged()), this, SIGNAL(globalSettingsChanged())); + connect(page, &KateSQLConfigPage::settingsChanged, this, &KateSQLPlugin::globalSettingsChanged); return page; } diff --git a/addons/katesql/katesqlview.cpp b/addons/katesql/katesqlview.cpp --- a/addons/katesql/katesqlview.cpp +++ b/addons/katesql/katesqlview.cpp @@ -89,15 +89,14 @@ m_connectionsGroup = new QActionGroup(sqlMenu); m_connectionsGroup->setExclusive(true); - connect(sqlMenu, SIGNAL(aboutToShow()), this, SLOT(slotSQLMenuAboutToShow())); - connect(m_connectionsGroup, SIGNAL(triggered(QAction*)), this, SLOT(slotConnectionSelectedFromMenu(QAction*))); - - connect(m_manager, SIGNAL(error(QString)), this, SLOT(slotError(QString))); - connect(m_manager, SIGNAL(success(QString)), this, SLOT(slotSuccess(QString))); - connect(m_manager, SIGNAL(queryActivated(QSqlQuery&,QString)), this, SLOT(slotQueryActivated(QSqlQuery&,QString))); - connect(m_manager, SIGNAL(connectionCreated(QString)), this, SLOT(slotConnectionCreated(QString))); - connect(m_manager, SIGNAL(connectionAboutToBeClosed(QString)), this, SLOT(slotConnectionAboutToBeClosed(QString))); - connect(m_connectionsComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotConnectionChanged(QString))); + connect(sqlMenu, &QMenu::aboutToShow, this, &KateSQLView::slotSQLMenuAboutToShow); + connect(m_connectionsGroup, &QActionGroup::triggered, this, &KateSQLView::slotConnectionSelectedFromMenu); + connect(m_manager, &SQLManager::error, this, &KateSQLView::slotError); + connect(m_manager, &SQLManager::success, this, &KateSQLView::slotSuccess); + connect(m_manager, &SQLManager::queryActivated, this, &KateSQLView::slotQueryActivated); + connect(m_manager, &SQLManager::connectionCreated, this, &KateSQLView::slotConnectionCreated); + connect(m_manager, &SQLManager::connectionAboutToBeClosed, this, &KateSQLView::slotConnectionAboutToBeClosed); + connect(m_connectionsComboBox, static_cast(&KComboBox::currentIndexChanged), this, &KateSQLView::slotConnectionChanged); stateChanged(QLatin1String ("has_connection_selected"), KXMLGUIClient::StateReverse); } @@ -122,22 +121,22 @@ action = collection->addAction(QLatin1String ("connection_create")); action->setText( i18nc("@action:inmenu", "Add connection...") ); action->setIcon( QIcon::fromTheme (QLatin1String ("list-add")) ); - connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionCreate()) ); + connect(action, &QAction::triggered, this, &KateSQLView::slotConnectionCreate); action = collection->addAction(QLatin1String ("connection_remove")); action->setText( i18nc("@action:inmenu", "Remove connection") ); action->setIcon( QIcon::fromTheme (QLatin1String ("list-remove")) ); - connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionRemove()) ); + connect(action, &QAction::triggered, this, &KateSQLView::slotConnectionRemove); action = collection->addAction(QLatin1String ("connection_edit")); action->setText( i18nc("@action:inmenu", "Edit connection...") ); action->setIcon( QIcon::fromTheme (QLatin1String ("configure")) ); - connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionEdit()) ); + connect(action, &QAction::triggered, this, &KateSQLView::slotConnectionEdit); action = collection->addAction(QLatin1String ("connection_reconnect")); action->setText( i18nc("@action:inmenu", "Reconnect") ); action->setIcon( QIcon::fromTheme (QLatin1String ("view-refresh")) ); - connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionReconnect()) ); + connect(action, &QAction::triggered, this, &KateSQLView::slotConnectionReconnect); QWidgetAction *wa = new QWidgetAction(this); collection->addAction(QLatin1String ("connection_chooser"), wa); @@ -148,7 +147,7 @@ action->setText( i18nc("@action:inmenu", "Run query") ); action->setIcon( QIcon::fromTheme (QLatin1String ("quickopen")) ); collection->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::Key_E) ); - connect( action , SIGNAL(triggered()) , this , SLOT(slotRunQuery())); + connect(action, &QAction::triggered, this, &KateSQLView::slotRunQuery); /// TODO: stop sql query // action = collection->addAction("sql_stop"); diff --git a/addons/katesql/outputstylewidget.cpp b/addons/katesql/outputstylewidget.cpp --- a/addons/katesql/outputstylewidget.cpp +++ b/addons/katesql/outputstylewidget.cpp @@ -98,12 +98,12 @@ readConfig(item); - connect(boldCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); - connect(italicCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); - connect(underlineCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); - connect(strikeOutCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotChanged())); - connect(foregroundColorButton, SIGNAL(changed(QColor)), this, SLOT(slotChanged())); - connect(backgroundColorButton, SIGNAL(changed(QColor)), this, SLOT(slotChanged())); + connect(boldCheckBox, &QCheckBox::toggled, this, &OutputStyleWidget::slotChanged); + connect(italicCheckBox, &QCheckBox::toggled, this, &OutputStyleWidget::slotChanged); + connect(underlineCheckBox, &QCheckBox::toggled, this, &OutputStyleWidget::slotChanged); + connect(strikeOutCheckBox, &QCheckBox::toggled, this, &OutputStyleWidget::slotChanged); + connect(foregroundColorButton, &KColorButton::changed, this, &OutputStyleWidget::slotChanged); + connect(backgroundColorButton, &KColorButton::changed, this, &OutputStyleWidget::slotChanged); return item; } diff --git a/addons/katesql/schemawidget.cpp b/addons/katesql/schemawidget.cpp --- a/addons/katesql/schemawidget.cpp +++ b/addons/katesql/schemawidget.cpp @@ -51,8 +51,8 @@ setDragEnabled(true); setAcceptDrops(false); - connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotCustomContextMenuRequested(QPoint))); - connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(slotItemExpanded(QTreeWidgetItem*))); + connect(this, &SchemaWidget::customContextMenuRequested, this, &SchemaWidget::slotCustomContextMenuRequested); + connect(this, &SchemaWidget::itemExpanded, this, &SchemaWidget::slotItemExpanded); } diff --git a/addons/katesql/textoutputwidget.cpp b/addons/katesql/textoutputwidget.cpp --- a/addons/katesql/textoutputwidget.cpp +++ b/addons/katesql/textoutputwidget.cpp @@ -55,8 +55,7 @@ QAction *action = new QAction( QIcon::fromTheme(QLatin1String("edit-clear")), i18nc("@action:intoolbar", "Clear"), this); toolbar->addAction(action); - connect(action, SIGNAL(triggered()), m_output, SLOT(clear())); - + connect(action, &QAction::triggered, m_output, &QTextEdit::clear); m_layout->addWidget(toolbar); m_layout->addWidget(m_output, 1); m_layout->setContentsMargins(0, 0, 0, 0); diff --git a/addons/konsole/kateconsole.cpp b/addons/konsole/kateconsole.cpp --- a/addons/konsole/kateconsole.cpp +++ b/addons/konsole/kateconsole.cpp @@ -131,16 +131,15 @@ QAction* a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_pipe_to_terminal")); a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); a->setText(i18nc("@action", "&Pipe to Terminal")); - connect(a, SIGNAL(triggered()), this, SLOT(slotPipeToConsole())); - + connect(a, &QAction::triggered, this, &KateConsole::slotPipeToConsole); a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_sync")); a->setText(i18nc("@action", "S&ynchronize Terminal with Current Document")); - connect(a, SIGNAL(triggered()), this, SLOT(slotManualSync())); + connect(a, &QAction::triggered, this, &KateConsole::slotManualSync); a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_toggle_focus")); a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); a->setText(i18nc("@action", "&Focus Terminal")); - connect(a, SIGNAL(triggered()), this, SLOT(slotToggleFocus())); + connect(a, &QAction::triggered, this, &KateConsole::slotToggleFocus); m_mw->guiFactory()->addClient (this); @@ -151,7 +150,7 @@ { m_mw->guiFactory()->removeClient (this); if (m_part) - disconnect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); + disconnect(m_part, &KParts::ReadOnlyPart::destroyed, this, &KateConsole::slotDestroyed); } void KateConsole::loadConsoleIfNeeded() @@ -183,7 +182,7 @@ setFocusProxy(m_part->widget()); m_part->widget()->show(); - connect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); + connect(m_part, &KParts::ReadOnlyPart::destroyed, this, &KateConsole::slotDestroyed); connect ( m_part, SIGNAL(overrideShortcut(QKeyEvent*,bool&)), this, SLOT(overrideShortcut(QKeyEvent*,bool&))); slotSync(); @@ -347,8 +346,8 @@ lo->addWidget(tmp); reset(); lo->addStretch(); - connect( cbAutoSyncronize, SIGNAL(stateChanged(int)), SIGNAL(changed()) ); - connect( cbSetEditor, SIGNAL(stateChanged(int)), SIGNAL(changed()) ); + connect(cbAutoSyncronize, &QCheckBox::stateChanged, this, &KateKonsoleConfigPage::changed); + connect(cbSetEditor, &QCheckBox::stateChanged, this, &KateKonsoleConfigPage::changed); } QString KateKonsoleConfigPage::name() const diff --git a/addons/lumen/lumen.cpp b/addons/lumen/lumen.cpp --- a/addons/lumen/lumen.cpp +++ b/addons/lumen/lumen.cpp @@ -61,9 +61,7 @@ this, &LumenPluginView::documentChanged, Qt::UniqueConnection); - connect(view->document(), SIGNAL(documentUrlChanged(KTextEditor::Document*)), - this, SLOT(urlChanged(KTextEditor::Document*))); - + connect(view->document(), &Document::documentUrlChanged, this, &LumenPluginView::urlChanged); registerCompletion(view); } @@ -184,4 +182,4 @@ return new LumenPluginView(this, mainWin); } -#include "lumen.moc" \ No newline at end of file +#include "lumen.moc" diff --git a/addons/openheader/plugin_kateopenheader.cpp b/addons/openheader/plugin_kateopenheader.cpp --- a/addons/openheader/plugin_kateopenheader.cpp +++ b/addons/openheader/plugin_kateopenheader.cpp @@ -52,8 +52,7 @@ QAction *a = actionCollection()->addAction(QStringLiteral("file_openheader")); a->setText(i18n("Open .h/.cpp/.c")); actionCollection()->setDefaultShortcut(a, Qt::Key_F12 ); - connect( a, SIGNAL(triggered(bool)), plugin, SLOT(slotOpenHeader()) ); - + connect(a, &QAction::triggered, plugin, &PluginKateOpenHeader::slotOpenHeader); mainwindow->guiFactory()->addClient (this); } diff --git a/addons/project/kateprojectinfoviewcodeanalysis.cpp b/addons/project/kateprojectinfoviewcodeanalysis.cpp --- a/addons/project/kateprojectinfoviewcodeanalysis.cpp +++ b/addons/project/kateprojectinfoviewcodeanalysis.cpp @@ -74,8 +74,8 @@ /** * connect needed signals */ - connect(m_startStopAnalysis, SIGNAL(clicked(bool)), this, SLOT(slotStartStopClicked())); - connect(m_treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(slotClicked(const QModelIndex &))); + connect(m_startStopAnalysis, &QPushButton::clicked, this, &KateProjectInfoViewCodeAnalysis::slotStartStopClicked); + connect(m_treeView, &QTreeView::clicked, this, &KateProjectInfoViewCodeAnalysis::slotClicked); } KateProjectInfoViewCodeAnalysis::~KateProjectInfoViewCodeAnalysis() @@ -100,9 +100,9 @@ m_analyzer = new QProcess(this); m_analyzer->setProcessChannelMode(QProcess::MergedChannels); - connect(m_analyzer, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); - connect(m_analyzer, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(finished(int, QProcess::ExitStatus))); + connect(m_analyzer, &QProcess::readyRead, this, &KateProjectInfoViewCodeAnalysis::slotReadyRead); + connect(m_analyzer, static_cast(&QProcess::finished), + this, &KateProjectInfoViewCodeAnalysis::finished); QStringList args; args << QStringLiteral("-q") << QStringLiteral("--inline-suppr") << QStringLiteral("--enable=all") << QStringLiteral("--template={file}////{line}////{severity}////{message}") << QStringLiteral("--file-list=-"); diff --git a/addons/project/kateprojectinfoviewindex.cpp b/addons/project/kateprojectinfoviewindex.cpp --- a/addons/project/kateprojectinfoviewindex.cpp +++ b/addons/project/kateprojectinfoviewindex.cpp @@ -65,10 +65,10 @@ /** * connect needed signals */ - connect(m_pluginView, SIGNAL(projectLookupWord(const QString &)), m_lineEdit, SLOT(setText(const QString &))); - connect(m_lineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotTextChanged(const QString &))); - connect(m_treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(slotClicked(const QModelIndex &))); - connect(m_project, SIGNAL(indexChanged()), this, SLOT(indexAvailable())); + connect(m_pluginView, &KateProjectPluginView::projectLookupWord, m_lineEdit, &QLineEdit::setText); + connect(m_lineEdit, &QLineEdit::textChanged, this, &KateProjectInfoViewIndex::slotTextChanged); + connect(m_treeView, &QTreeView::clicked, this, &KateProjectInfoViewIndex::slotClicked); + connect(m_project, &KateProject::indexChanged, this, &KateProjectInfoViewIndex::indexAvailable); /** * trigger once search with nothing diff --git a/addons/project/kateprojectinfoviewterminal.cpp b/addons/project/kateprojectinfoviewterminal.cpp --- a/addons/project/kateprojectinfoviewterminal.cpp +++ b/addons/project/kateprojectinfoviewterminal.cpp @@ -51,7 +51,7 @@ * avoid endless loop */ if (m_konsolePart) { - disconnect(m_konsolePart, SIGNAL(destroyed()), this, SLOT(loadTerminal())); + disconnect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &KateProjectInfoViewTerminal::loadTerminal); } } @@ -97,7 +97,7 @@ /** * guard destruction, create new terminal! */ - connect(m_konsolePart, SIGNAL(destroyed()), this, SLOT(loadTerminal())); + connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &KateProjectInfoViewTerminal::loadTerminal); connect(m_konsolePart, SIGNAL(overrideShortcut(QKeyEvent *, bool &)), this, SLOT(overrideShortcut(QKeyEvent *, bool &))); } diff --git a/addons/project/kateprojectpluginview.cpp b/addons/project/kateprojectpluginview.cpp --- a/addons/project/kateprojectpluginview.cpp +++ b/addons/project/kateprojectpluginview.cpp @@ -96,7 +96,7 @@ m_lookupAction = popup->menu()->addAction(i18n("Lookup: %1", QString()), this, SLOT(slotProjectIndex())); - connect(popup->menu(), SIGNAL(aboutToShow()), this, SLOT(slotContextMenuAboutToShow())); + connect(popup->menu(), &QMenu::aboutToShow, this, &KateProjectPluginView::slotContextMenuAboutToShow); /** * add us to gui @@ -165,7 +165,7 @@ m_stackedProjectViews = new QStackedWidget(m_toolView); m_stackedProjectInfoViews = new QStackedWidget(m_toolInfoView); - connect(m_projectsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentChanged(int))); + connect(m_projectsCombo, static_cast(&QComboBox::currentIndexChanged), this, &KateProjectPluginView::slotCurrentChanged); connect(m_reloadButton, &QToolButton::clicked, this, &KateProjectPluginView::slotProjectReload); } diff --git a/addons/replicode/replicodeconfigpage.cpp b/addons/replicode/replicodeconfigpage.cpp --- a/addons/replicode/replicodeconfigpage.cpp +++ b/addons/replicode/replicodeconfigpage.cpp @@ -44,7 +44,7 @@ reset(); - connect(m_requester, SIGNAL(textChanged(QString)), SIGNAL(changed())); + connect(m_requester, &KUrlRequester::textChanged, this, &ReplicodeConfigPage::changed); } QString ReplicodeConfigPage::name() const diff --git a/addons/replicode/replicodeview.cpp b/addons/replicode/replicodeview.cpp --- a/addons/replicode/replicodeview.cpp +++ b/addons/replicode/replicodeview.cpp @@ -36,12 +36,12 @@ { m_runAction = new QAction(QIcon(QStringLiteral("code-block")), i18n("Run replicode"), this); actionCollection()->setDefaultShortcut(m_runAction, Qt::Key_F8); - connect(m_runAction, SIGNAL(triggered()), SLOT(runReplicode())); + connect(m_runAction, &QAction::triggered, this, &ReplicodeView::runReplicode); actionCollection()->addAction(QStringLiteral("katereplicode_run"), m_runAction); m_stopAction = new QAction(QIcon(QStringLiteral("process-stop")), i18n("Stop replicode"), this); actionCollection()->setDefaultShortcut(m_stopAction, Qt::Key_F9); - connect(m_stopAction, SIGNAL(triggered()), SLOT(stopReplicode())); + connect(m_stopAction, &QAction::triggered, this, &ReplicodeView::stopReplicode); actionCollection()->addAction(QStringLiteral("katereplicode_stop"), m_stopAction); m_stopAction->setEnabled(false); @@ -53,7 +53,7 @@ i18n("Replicode Output")); m_replicodeOutput = new QListWidget(m_toolview); m_replicodeOutput->setSelectionMode(QAbstractItemView::ContiguousSelection); - connect(m_replicodeOutput, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(outputClicked(QListWidgetItem*))); + connect(m_replicodeOutput, &QListWidget::itemActivated, this, &ReplicodeView::outputClicked); m_mainWindow->hideToolView(m_toolview); m_configSidebar = m_mainWindow->createToolView( @@ -71,11 +71,11 @@ QFormLayout *l = qobject_cast(m_configView->widget(0)->layout()); Q_ASSERT(l); l->addRow(m_runButton, m_stopButton); - connect(m_runButton, SIGNAL(clicked()), m_runAction, SLOT(trigger())); - connect(m_stopButton, SIGNAL(clicked()), m_stopAction, SLOT(trigger())); + connect(m_runButton, &QPushButton::clicked, m_runAction, &QAction::trigger); + connect(m_stopButton, &QPushButton::clicked, m_stopAction, &QAction::trigger); m_mainWindow->guiFactory()->addClient(this); - connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View*)), SLOT(viewChanged())); + connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &ReplicodeView::viewChanged); } ReplicodeView::~ReplicodeView() @@ -147,10 +147,10 @@ if (m_executor) delete m_executor; m_executor = new QProcess(this); m_executor->setWorkingDirectory(sourceFile.canonicalPath()); - connect(m_executor, SIGNAL(readyReadStandardError()), SLOT(gotStderr())); - connect(m_executor, SIGNAL(readyReadStandardOutput()), SLOT(gotStdout())); - connect(m_executor, SIGNAL(finished(int)), SLOT(replicodeFinished())); - connect(m_executor, SIGNAL(error(QProcess::ProcessError)), SLOT(runErrored(QProcess::ProcessError))); + connect(m_executor, &QProcess::readyReadStandardError, this, &ReplicodeView::gotStderr); + connect(m_executor, &QProcess::readyReadStandardOutput, this, &ReplicodeView::gotStdout); + connect(m_executor, static_cast(&QProcess::finished), this, &ReplicodeView::replicodeFinished); + connect(m_executor, static_cast(&QProcess::error), this, &ReplicodeView::runErrored); qDebug() << executorPath << sourceFile.canonicalPath(); m_completed = false; m_executor->start(executorPath, QStringList(), QProcess::ReadOnly); diff --git a/addons/search/plugin_search.cpp b/addons/search/plugin_search.cpp --- a/addons/search/plugin_search.cpp +++ b/addons/search/plugin_search.cpp @@ -135,12 +135,11 @@ QObject *KatePluginSearch::createView(KTextEditor::MainWindow *mainWindow) { KatePluginSearchView *view = new KatePluginSearchView(this, mainWindow, KTextEditor::Editor::instance()->application()); - connect(m_searchCommand, SIGNAL(setSearchPlace(int)), view, SLOT(setSearchPlace(int))); - connect(m_searchCommand, SIGNAL(setCurrentFolder()), view, SLOT(setCurrentFolder())); - connect(m_searchCommand, SIGNAL(setSearchString(QString)), view, SLOT(setSearchString(QString))); - connect(m_searchCommand, SIGNAL(startSearch()), view, SLOT(startSearch())); + connect(m_searchCommand, &KateSearchCommand::setSearchPlace, view, &KatePluginSearchView::setSearchPlace); + connect(m_searchCommand, &KateSearchCommand::setCurrentFolder, view, &KatePluginSearchView::setCurrentFolder); + connect(m_searchCommand, &KateSearchCommand::setSearchString, view, &KatePluginSearchView::setSearchString); + connect(m_searchCommand, &KateSearchCommand::startSearch, view, &KatePluginSearchView::startSearch); connect(m_searchCommand, SIGNAL(newTab()), view, SLOT(addTab())); - return view; } @@ -236,26 +235,26 @@ ContainerWidget *container = new ContainerWidget(m_toolView); m_ui.setupUi(container); container->setFocusProxy(m_ui.searchCombo); - connect(container, SIGNAL(nextFocus(QWidget*,bool*,bool)), this, SLOT(nextFocus(QWidget*,bool*,bool))); + connect(container, &ContainerWidget::nextFocus, this, &KatePluginSearchView::nextFocus); QAction *a = actionCollection()->addAction(QStringLiteral("search_in_files")); actionCollection()->setDefaultShortcut(a, QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_F)); a->setText(i18n("Search in Files")); - connect(a, SIGNAL(triggered(bool)), this, SLOT(openSearchView())); + connect(a, &QAction::triggered, this, &KatePluginSearchView::openSearchView); a = actionCollection()->addAction(QStringLiteral("search_in_files_new_tab")); a->setText(i18n("Search in Files (in new tab)")); // first add tab, then open search view, since open search view switches to show the search options - connect(a, SIGNAL(triggered(bool)), this, SLOT(addTab())); - connect(a, SIGNAL(triggered(bool)), this, SLOT(openSearchView())); + connect(a, &QAction::triggered, this, &KatePluginSearchView::addTab); + connect(a, &QAction::triggered, this, &KatePluginSearchView::openSearchView); a = actionCollection()->addAction(QStringLiteral("go_to_next_match")); a->setText(i18n("Go to Next Match")); - connect(a, SIGNAL(triggered(bool)), this, SLOT(goToNextMatch())); + connect(a, &QAction::triggered, this, &KatePluginSearchView::goToNextMatch); a = actionCollection()->addAction(QStringLiteral("go_to_prev_match")); a->setText(i18n("Go to Previous Match")); - connect(a, SIGNAL(triggered(bool)), this, SLOT(goToPreviousMatch())); + connect(a, &QAction::triggered, this, &KatePluginSearchView::goToPreviousMatch); m_ui.resultTabWidget->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectLeftTab); KAcceleratorManager::setNoAccel(m_ui.resultTabWidget); @@ -290,94 +289,87 @@ cmbUrl->setCompletionObject(cmpl); cmbUrl->setAutoDeleteCompletionObject(true); - connect(m_ui.newTabButton, SIGNAL(clicked()), this, SLOT(addTab())); - connect(m_ui.resultTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(tabCloseRequested(int))); - connect(m_ui.resultTabWidget, SIGNAL(currentChanged(int)), this, SLOT(resultTabChanged(int))); + connect(m_ui.newTabButton, &QToolButton::clicked, this, &KatePluginSearchView::addTab); + connect(m_ui.resultTabWidget, &QTabWidget::tabCloseRequested, this, &KatePluginSearchView::tabCloseRequested); + connect(m_ui.resultTabWidget, &QTabWidget::currentChanged, this, &KatePluginSearchView::resultTabChanged); - connect(m_ui.folderUpButton, SIGNAL(clicked()), this, SLOT(navigateFolderUp())); - connect(m_ui.currentFolderButton, SIGNAL(clicked()), this, SLOT(setCurrentFolder())); - connect(m_ui.expandResults, SIGNAL(clicked()), this, SLOT(expandResults())); + connect(m_ui.folderUpButton, &QToolButton::clicked, this, &KatePluginSearchView::navigateFolderUp); + connect(m_ui.currentFolderButton, &QToolButton::clicked, this, &KatePluginSearchView::setCurrentFolder); + connect(m_ui.expandResults, &QToolButton::clicked, this, &KatePluginSearchView::expandResults); - connect(m_ui.searchCombo, SIGNAL(editTextChanged(QString)), &m_changeTimer, SLOT(start())); - connect(m_ui.matchCase, SIGNAL(toggled(bool)), &m_changeTimer, SLOT(start())); - connect(m_ui.matchCase, &QToolButton::toggled, this, [this](bool) { + connect(m_ui.searchCombo, &QComboBox::editTextChanged, &m_changeTimer, static_cast(&QTimer::start)); + connect(m_ui.matchCase, &QToolButton::toggled, &m_changeTimer, static_cast(&QTimer::start)); + connect(m_ui.matchCase, &QToolButton::toggled, [=]{ Results *res = qobject_cast(m_ui.resultTabWidget->currentWidget()); if (res) { res->matchCase = m_ui.matchCase->isChecked(); } }); - connect(m_ui.useRegExp, SIGNAL(toggled(bool)), &m_changeTimer, SLOT(start())); - connect(m_ui.useRegExp, &QToolButton::toggled, this, [this](bool) { + connect(m_ui.useRegExp, &QToolButton::toggled, &m_changeTimer, static_cast(&QTimer::start)); + connect(m_ui.useRegExp, &QToolButton::toggled, [=]{ Results *res = qobject_cast(m_ui.resultTabWidget->currentWidget()); if (res) { res->useRegExp = m_ui.useRegExp->isChecked(); } }); m_changeTimer.setInterval(300); m_changeTimer.setSingleShot(true); - connect(&m_changeTimer, SIGNAL(timeout()), this, SLOT(startSearchWhileTyping())); + connect(&m_changeTimer, &QTimer::timeout, this, &KatePluginSearchView::startSearchWhileTyping); - connect(m_ui.searchCombo->lineEdit(), SIGNAL(returnPressed()), this, SLOT(startSearch())); + connect(m_ui.searchCombo->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch); // connecting to returnPressed() of the folderRequester doesn't work, I haven't found out why yet. But connecting to the linedit works: - connect(m_ui.folderRequester->comboBox()->lineEdit(), SIGNAL(returnPressed()), this, SLOT(startSearch())); - connect(m_ui.filterCombo, SIGNAL(returnPressed()), this, SLOT(startSearch())); - connect(m_ui.excludeCombo, SIGNAL(returnPressed()), this, SLOT(startSearch())); - connect(m_ui.searchButton, SIGNAL(clicked()), this, SLOT(startSearch())); + connect(m_ui.folderRequester->comboBox()->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::startSearch); + connect(m_ui.filterCombo, static_cast(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch); + connect(m_ui.excludeCombo, static_cast(&KComboBox::returnPressed), this, &KatePluginSearchView::startSearch); + connect(m_ui.searchButton, &QPushButton::clicked, this, &KatePluginSearchView::startSearch); - connect(m_ui.displayOptions, SIGNAL(toggled(bool)), this, SLOT(toggleOptions(bool))); - connect(m_ui.searchPlaceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(searchPlaceChanged())); + connect(m_ui.displayOptions, &QToolButton::toggled, this, &KatePluginSearchView::toggleOptions); + connect(m_ui.searchPlaceCombo, static_cast(&QComboBox::currentIndexChanged), this, &KatePluginSearchView::searchPlaceChanged); connect(m_ui.searchPlaceCombo, static_cast(&QComboBox::currentIndexChanged), this, [this](int) { if (m_ui.searchPlaceCombo->currentIndex() == Folder) { m_ui.displayOptions->setChecked(true); } }); - connect(m_ui.stopButton, SIGNAL(clicked()), &m_searchOpenFiles, SLOT(cancelSearch())); - connect(m_ui.stopButton, SIGNAL(clicked()), &m_searchDiskFiles, SLOT(cancelSearch())); - connect(m_ui.stopButton, SIGNAL(clicked()), &m_folderFilesList, SLOT(cancelSearch())); - connect(m_ui.stopButton, SIGNAL(clicked()), &m_replacer, SLOT(cancelReplace())); + connect(m_ui.stopButton, &QPushButton::clicked, &m_searchOpenFiles, &SearchOpenFiles::cancelSearch); + connect(m_ui.stopButton, &QPushButton::clicked, &m_searchDiskFiles, &SearchDiskFiles::cancelSearch); + connect(m_ui.stopButton, &QPushButton::clicked, &m_folderFilesList, &FolderFilesList::cancelSearch); + connect(m_ui.stopButton, &QPushButton::clicked, &m_replacer, &ReplaceMatches::cancelReplace); - connect(m_ui.nextButton, SIGNAL(clicked()), this, SLOT(goToNextMatch())); + connect(m_ui.newTabButton, &QToolButton::clicked, this, &KatePluginSearchView::goToNextMatch); - connect(m_ui.replaceButton, SIGNAL(clicked(bool)), this, SLOT(replaceSingleMatch())); - connect(m_ui.replaceCheckedBtn, SIGNAL(clicked(bool)), this, SLOT(replaceChecked())); - connect(m_ui.replaceCombo->lineEdit(), SIGNAL(returnPressed()), this, SLOT(replaceChecked())); + connect(m_ui.replaceButton, &QPushButton::clicked, this, &KatePluginSearchView::replaceSingleMatch); + connect(m_ui.replaceCheckedBtn, &QPushButton::clicked, this, &KatePluginSearchView::replaceChecked); + connect(m_ui.replaceCombo->lineEdit(), &QLineEdit::returnPressed, this, &KatePluginSearchView::replaceChecked); m_ui.displayOptions->setChecked(true); - connect(&m_searchOpenFiles, SIGNAL(matchFound(QString,QString,int,int,QString,int)), - this, SLOT(matchFound(QString,QString,int,int,QString,int))); - connect(&m_searchOpenFiles, SIGNAL(searchDone()), this, SLOT(searchDone())); - connect(&m_searchOpenFiles, SIGNAL(searching(QString)), this, SLOT(searching(QString))); + connect(&m_searchOpenFiles, &SearchOpenFiles::matchFound, this, &KatePluginSearchView::matchFound); + connect(&m_searchOpenFiles, &SearchOpenFiles::searchDone, this, &KatePluginSearchView::searchDone); + connect(&m_searchOpenFiles, static_cast(&SearchOpenFiles::searching), this, &KatePluginSearchView::searching); - connect(&m_folderFilesList, SIGNAL(finished()), this, SLOT(folderFileListChanged())); - connect(&m_folderFilesList, SIGNAL(searching(QString)), this, SLOT(searching(QString))); + connect(&m_folderFilesList, &FolderFilesList::finished, this, &KatePluginSearchView::folderFileListChanged); + connect(&m_folderFilesList, &FolderFilesList::searching, this, &KatePluginSearchView::searching); - connect(&m_searchDiskFiles, SIGNAL(matchFound(QString,QString,int,int,QString,int)), - this, SLOT(matchFound(QString,QString,int,int,QString,int))); - connect(&m_searchDiskFiles, SIGNAL(searchDone()), this, SLOT(searchDone())); - connect(&m_searchDiskFiles, SIGNAL(searching(QString)), this, SLOT(searching(QString))); + connect(&m_searchDiskFiles, &SearchDiskFiles::matchFound, this, &KatePluginSearchView::matchFound); + connect(&m_searchDiskFiles, &SearchDiskFiles::searchDone, this, &KatePluginSearchView::searchDone); + connect(&m_searchDiskFiles, static_cast(&SearchDiskFiles::searching), this, &KatePluginSearchView::searching); - connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), - &m_searchOpenFiles, SLOT(cancelSearch())); + connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, &m_searchOpenFiles, &SearchOpenFiles::cancelSearch); - connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), - &m_replacer, SLOT(cancelReplace())); + connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, &m_replacer, &ReplaceMatches::cancelReplace); - connect(m_kateApp, SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), - this, SLOT(clearDocMarks(KTextEditor::Document*))); + connect(m_kateApp, &KTextEditor::Application::documentWillBeDeleted, this, &KatePluginSearchView::clearDocMarks); - connect(&m_replacer, SIGNAL(matchReplaced(KTextEditor::Document*,int,int,int)), - this, SLOT(addMatchMark(KTextEditor::Document*,int,int,int))); + connect(&m_replacer, &ReplaceMatches::matchReplaced, this, &KatePluginSearchView::addMatchMark); connect(&m_replacer, &ReplaceMatches::replaceStatus, this, &KatePluginSearchView::replaceStatus); // Hook into line edit context menus m_ui.searchCombo->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_ui.searchCombo, SIGNAL(customContextMenuRequested(QPoint)), this, - SLOT(searchContextMenu(QPoint))); + connect(m_ui.searchButton, &QPushButton::customContextMenuRequested, this, &KatePluginSearchView::searchContextMenu); m_ui.searchCombo->completer()->setCompletionMode(QCompleter::PopupCompletion); m_ui.searchCombo->completer()->setCaseSensitivity(Qt::CaseSensitive); m_ui.searchCombo->setInsertPolicy(QComboBox::NoInsert); @@ -392,25 +384,22 @@ m_toolView->setMinimumHeight(container->sizeHint().height()); - connect(m_mainWindow, SIGNAL(unhandledShortcutOverride(QEvent*)), - this, SLOT(handleEsc(QEvent*))); + connect(m_mainWindow, &KTextEditor::MainWindow::unhandledShortcutOverride, this, &KatePluginSearchView::handleEsc); // watch for project plugin view creation/deletion - connect(m_mainWindow, SIGNAL(pluginViewCreated (const QString &, QObject *)) - , this, SLOT(slotPluginViewCreated (const QString &, QObject *))); + connect(m_mainWindow, &KTextEditor::MainWindow::pluginViewCreated, this, &KatePluginSearchView::slotPluginViewCreated); - connect(m_mainWindow, SIGNAL(pluginViewDeleted (const QString &, QObject *)) - , this, SLOT(slotPluginViewDeleted (const QString &, QObject *))); + connect(m_mainWindow, &KTextEditor::MainWindow::pluginViewDeleted, this, &KatePluginSearchView::slotPluginViewDeleted); - connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(docViewChanged())); + connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KatePluginSearchView::docViewChanged); // update once project plugin state manually m_projectPluginView = m_mainWindow->pluginView (QStringLiteral("kateprojectplugin")); slotProjectFileNameChanged (); m_replacer.setDocumentManager(m_kateApp); - connect(&m_replacer, SIGNAL(replaceDone()), this, SLOT(replaceDone())); + connect(&m_replacer, &ReplaceMatches::replaceDone, this, &KatePluginSearchView::replaceDone); searchPlaceChanged(); @@ -1919,8 +1908,7 @@ res->tree->setRootIsDecorated(false); - connect(res->tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), - this, SLOT (itemSelected(QTreeWidgetItem*)), Qt::QueuedConnection); + connect(res->tree, &QTreeWidget::itemDoubleClicked, this, &KatePluginSearchView::itemSelected, Qt::UniqueConnection); res->searchPlaceIndex = m_ui.searchPlaceCombo->currentIndex(); res->useRegExp = m_ui.useRegExp->isChecked(); diff --git a/addons/search/replace_matches.cpp b/addons/search/replace_matches.cpp --- a/addons/search/replace_matches.cpp +++ b/addons/search/replace_matches.cpp @@ -31,7 +31,7 @@ m_tree(nullptr), m_rootIndex(-1) { - connect(this, SIGNAL(replaceNextMatch()), this, SLOT(doReplaceNextMatch()), Qt::QueuedConnection); + connect(this, &ReplaceMatches::replaceNextMatch, this, &ReplaceMatches::doReplaceNextMatch, Qt::QueuedConnection); } void ReplaceMatches::replaceChecked(QTreeWidget *tree, const QRegularExpression ®exp, const QString &replace) diff --git a/addons/search/search_open_files.cpp b/addons/search/search_open_files.cpp --- a/addons/search/search_open_files.cpp +++ b/addons/search/search_open_files.cpp @@ -24,7 +24,7 @@ SearchOpenFiles::SearchOpenFiles(QObject *parent) : QObject(parent), m_nextIndex(-1), m_cancelSearch(true) { - connect(this, SIGNAL(searchNextFile(int)), this, SLOT(doSearchNextFile(int)), Qt::QueuedConnection); + connect(this, &SearchOpenFiles::searchNextFile, this, &SearchOpenFiles::doSearchNextFile, Qt::QueuedConnection); } bool SearchOpenFiles::searching() { return !m_cancelSearch; } diff --git a/addons/sessionapplet/engine/katesessionsmodel.cpp b/addons/sessionapplet/engine/katesessionsmodel.cpp --- a/addons/sessionapplet/engine/katesessionsmodel.cpp +++ b/addons/sessionapplet/engine/katesessionsmodel.cpp @@ -51,7 +51,7 @@ dirwatch->addDir( m_sessionsDir ); - connect( dirwatch, SIGNAL(dirty(QString)), this, SLOT(slotUpdateSessionMenu()) ); + connect(dirwatch, &KDirWatch::dirty, this, &KateSessionsModel::slotUpdateSessionMenu); slotUpdateSessionMenu(); } diff --git a/addons/snippets/editrepository.cpp b/addons/snippets/editrepository.cpp --- a/addons/snippets/editrepository.cpp +++ b/addons/snippets/editrepository.cpp @@ -46,11 +46,11 @@ auto ok = buttonBox->button(QDialogButtonBox::Ok); KGuiItem::assign(ok, KStandardGuiItem::ok()); - connect(ok, SIGNAL(clicked()), this, SLOT(accept())); + connect(ok, &QPushButton::clicked, this, &EditRepository::accept); auto cancel = buttonBox->button(QDialogButtonBox::Cancel); KGuiItem::assign(cancel, KStandardGuiItem::cancel()); - connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(cancel, &QPushButton::clicked, this, &EditRepository::reject); // fill list of available modes QSharedPointer document(KTextEditor::Editor::instance()->createDocument(nullptr)); diff --git a/addons/symbolviewer/plugin_katesymbolviewer.cpp b/addons/symbolviewer/plugin_katesymbolviewer.cpp --- a/addons/symbolviewer/plugin_katesymbolviewer.cpp +++ b/addons/symbolviewer/plugin_katesymbolviewer.cpp @@ -106,10 +106,10 @@ func_on = true; m_updateTimer.setSingleShot(true); - connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(slotRefreshSymbol())); + connect(&m_updateTimer, &QTimer::timerId, this, &KatePluginSymbolViewerView::slotRefreshSymbol); m_currItemTimer.setSingleShot(true); - connect(&m_currItemTimer, SIGNAL(timeout()), this, SLOT(updateCurrTreeItem())); + connect(&m_currItemTimer, &QTimer::timeout, this, &KatePluginSymbolViewerView::updateCurrTreeItem); QPixmap cls( ( const char** ) class_xpm ); @@ -127,10 +127,10 @@ layout->addWidget(m_symbols, 10); layout->setContentsMargins(0,0,0,0); - connect(m_symbols, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(goToSymbol(QTreeWidgetItem*))); - connect(m_symbols, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotShowContextMenu(QPoint))); + connect(m_symbols, &QTreeWidget::itemClicked, this, &KatePluginSymbolViewerView::goToSymbol); + connect(m_symbols, &QTreeWidget::customContextMenuRequested, this, &KatePluginSymbolViewerView::slotShowContextMenu); - connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View *)), this, SLOT(slotDocChanged())); + connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &KatePluginSymbolViewerView::slotDocChanged); QStringList titles; titles << i18nc("@title:column", "Symbols") << i18nc("@title:column", "Position"); @@ -225,12 +225,10 @@ KTextEditor::View *view = m_mainWindow->activeView(); //qDebug()<<"Document changed !!!!" << view; if (view) { - connect(view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), - this, SLOT(cursorPositionChanged()), Qt::UniqueConnection); + connect(view, &KTextEditor::View::cursorPositionChanged, this, &KatePluginSymbolViewerView::cursorPositionChanged); if (view->document()) { - connect(view->document(), SIGNAL(textChanged(KTextEditor::Document*)), - this, SLOT(slotDocEdited()), Qt::UniqueConnection); + connect(view->document(), &KTextEditor::Document::textChanged, this, &KatePluginSymbolViewerView::slotDocEdited); } } } @@ -392,8 +390,7 @@ p->expandTree->setChecked(config.readEntry(QLatin1String("ExpandTree"), false)); p->treeView->setChecked(config.readEntry(QLatin1String("TreeView"), false)); p->sortSymbols->setChecked(config.readEntry(QLatin1String("SortSymbols"), false)); - connect( p, SIGNAL(configPageApplyRequest(KatePluginSymbolViewerConfigPage*)), - SLOT(applyConfig(KatePluginSymbolViewerConfigPage*)) ); + connect(p, &KatePluginSymbolViewerConfigPage::configPageApplyRequest, this, &KatePluginSymbolViewer::applyConfig); return (KTextEditor::ConfigPage*)p; } @@ -443,10 +440,10 @@ // throw signal changed - connect(viewReturns, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(expandTree, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(treeView, SIGNAL(toggled(bool)), this, SIGNAL(changed())); - connect(sortSymbols, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(viewReturns, &QCheckBox::toggled, this, &KatePluginSymbolViewerConfigPage::changed); + connect(expandTree, &QCheckBox::toggled, this, &KatePluginSymbolViewerConfigPage::changed); + connect(treeView, &QCheckBox::toggled, this, &KatePluginSymbolViewerConfigPage::changed); + connect(sortSymbols, &QCheckBox::toggled, this, &KatePluginSymbolViewerConfigPage::changed); } KatePluginSymbolViewerConfigPage::~KatePluginSymbolViewerConfigPage() {} diff --git a/addons/tabswitcher/tabswitcher.cpp b/addons/tabswitcher/tabswitcher.cpp --- a/addons/tabswitcher/tabswitcher.cpp +++ b/addons/tabswitcher/tabswitcher.cpp @@ -73,18 +73,17 @@ m_mainWindow->guiFactory()->addClient(this); // popup connections - connect(m_treeView, SIGNAL(pressed(QModelIndex)), SLOT(switchToClicked(QModelIndex))); - connect(m_treeView, SIGNAL(itemActivated(QModelIndex)), SLOT(activateView(QModelIndex))); + connect(m_treeView, &TabSwitcherTreeView::pressed, this, &TabSwitcherPluginView::switchToClicked); + connect(m_treeView, &TabSwitcherTreeView::itemActivated, this, &TabSwitcherPluginView::activateView); // track existing documents - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentCreated(KTextEditor::Document*)), - this, SLOT(registerDocument(KTextEditor::Document*))); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentWillBeDeleted(KTextEditor::Document*)), - this, SLOT(unregisterDocument(KTextEditor::Document*))); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentCreated, + this, &TabSwitcherPluginView::registerDocument); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentWillBeDeleted, + this, &TabSwitcherPluginView::unregisterDocument);; // track lru activation of views to raise the respective documents in the model - connect(m_mainWindow, SIGNAL(viewChanged(KTextEditor::View*)), - this, SLOT(raiseView(KTextEditor::View*))); + connect(m_mainWindow, &KTextEditor::MainWindow::viewChanged, this, &TabSwitcherPluginView::raiseView); } TabSwitcherPluginView::~TabSwitcherPluginView() @@ -107,15 +106,15 @@ actionCollection()->setDefaultShortcut(aNext, Qt::CTRL | Qt::Key_Tab); aNext->setWhatsThis(i18n("Opens a list to walk through the list of last used views.")); aNext->setStatusTip(i18n("Walk through the list of last used views")); - connect(aNext, SIGNAL(triggered()), SLOT(walkForward())); + connect(aNext, &QAction::triggered, this, &TabSwitcherPluginView::walkForward); auto aPrev = actionCollection()->addAction(QStringLiteral("view_lru_document_prev")); aPrev->setText(i18n("Last Used Views (Reverse)")); aPrev->setIcon(QIcon::fromTheme(QStringLiteral("go-previous-view-page"))); actionCollection()->setDefaultShortcut(aPrev, Qt::CTRL | Qt::SHIFT | Qt::Key_Tab); aPrev->setWhatsThis(i18n("Opens a list to walk through the list of last used views in reverse.")); aPrev->setStatusTip(i18n("Walk through the list of last used views")); - connect(aPrev, SIGNAL(triggered()), SLOT(walkBackward())); + connect(aPrev, &QAction::triggered, this, &TabSwitcherPluginView::walkBackward); // make sure action work when the popup has focus m_treeView->addAction(aNext); @@ -146,8 +145,7 @@ m_model->insertRow(0, item); // track document name changes - connect(document, SIGNAL(documentNameChanged(KTextEditor::Document*)), - this, SLOT(updateDocumentName(KTextEditor::Document*))); + connect(document, &KTextEditor::Document::documentNameChanged, this, &TabSwitcherPluginView::updateDocumentName); } void TabSwitcherPluginView::unregisterDocument(KTextEditor::Document * document) diff --git a/addons/textfilter/plugin_katetextfilter.cpp b/addons/textfilter/plugin_katetextfilter.cpp --- a/addons/textfilter/plugin_katetextfilter.cpp +++ b/addons/textfilter/plugin_katetextfilter.cpp @@ -204,14 +204,11 @@ { m_pFilterProcess = new KProcess; - connect (m_pFilterProcess, SIGNAL(readyReadStandardOutput()), - this, SLOT(slotFilterReceivedStdout())); + connect(m_pFilterProcess, &KProcess::readyReadStandardOutput, this, &PluginKateTextFilter::slotFilterReceivedStdout); - connect (m_pFilterProcess, SIGNAL(readyReadStandardError()), - this, SLOT(slotFilterReceivedStderr())); + connect(m_pFilterProcess, &KProcess::readyReadStandardError, this, &PluginKateTextFilter::slotFilterReceivedStderr); - connect (m_pFilterProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - this, SLOT(slotFilterProcessExited(int,QProcess::ExitStatus))); + connect(m_pFilterProcess, static_cast(&KProcess::finished), this, &PluginKateTextFilter::slotFilterProcessExited); } m_pFilterProcess->setOutputChannelMode( mergeOutput ? KProcess::MergedChannels : KProcess::SeparateChannels @@ -265,7 +262,7 @@ QAction* a = actionCollection()->addAction(QStringLiteral("edit_filter")); a->setText(i18n("Filter Te&xt...")); actionCollection()->setDefaultShortcut(a, Qt::CTRL + Qt::Key_Backslash); - connect(a, SIGNAL(triggered(bool)), plugin, SLOT(slotEditFilter())); + connect(a, &QAction::triggered, plugin, &PluginKateTextFilter::slotEditFilter); // register us at the UI mainwindow->guiFactory()->addClient(this); diff --git a/addons/xmlcheck/plugin_katexmlcheck.cpp b/addons/xmlcheck/plugin_katexmlcheck.cpp --- a/addons/xmlcheck/plugin_katexmlcheck.cpp +++ b/addons/xmlcheck/plugin_katexmlcheck.cpp @@ -122,7 +122,7 @@ m_tmp_file=nullptr; QAction *a = actionCollection()->addAction("xml_check"); a->setText(i18n("Validate XML")); - connect(a, SIGNAL(triggered()), this, SLOT(slotValidate())); + connect(a, &QAction::triggered, this, &PluginKateXMLCheckView::slotValidate); // TODO?: //(void) new KAction ( i18n("Indent XML"), KShortcut(), this, // SLOT(slotIndent()), actionCollection(), "xml_indent" ); @@ -135,7 +135,7 @@ headers << i18n("Message"); listview->setHeaderLabels(headers); listview->setRootIsDecorated(false); - connect(listview, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(slotClicked(QTreeWidgetItem*,int))); + connect(listview, &QTreeWidget::itemClicked, this, &PluginKateXMLCheckView::slotClicked); QHeaderView *header = listview->header(); header->setSectionResizeMode(0, QHeaderView::ResizeToContents); @@ -151,7 +151,7 @@ connect(kv, SIGNAL(modifiedChanged()), this, SLOT(slotUpdate())); */ - connect(&m_proc, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotProcExited(int,QProcess::ExitStatus))); + connect(&m_proc, static_cast(&QProcess::finished), this, &PluginKateXMLCheckView::slotProcExited); // we currently only want errors: m_proc.setProcessChannelMode(QProcess::SeparateChannels); // m_proc.setProcessChannelMode(QProcess::ForwardedChannels); // For Debugging. Do not use this. diff --git a/addons/xmltools/plugin_katexmltools.cpp b/addons/xmltools/plugin_katexmltools.cpp --- a/addons/xmltools/plugin_katexmltools.cpp +++ b/addons/xmltools/plugin_katexmltools.cpp @@ -125,23 +125,23 @@ setXMLFile(QLatin1String("ui.rc")); QAction *actionInsert = new QAction(i18n("&Insert Element..."), this); - connect(actionInsert, SIGNAL(triggered()), &m_model, SLOT(slotInsertElement())); + connect(actionInsert, &QAction::triggered, &m_model, &PluginKateXMLToolsCompletionModel::slotInsertElement); actionCollection()->addAction("xml_tool_insert_element", actionInsert); actionCollection()->setDefaultShortcut(actionInsert, Qt::CTRL + Qt::Key_Return); QAction *actionClose = new QAction(i18n("&Close Element"), this); - connect(actionClose, SIGNAL(triggered()), &m_model, SLOT(slotCloseElement())); + connect(actionClose, &QAction::triggered, &m_model, &PluginKateXMLToolsCompletionModel::slotCloseElement); actionCollection()->addAction("xml_tool_close_element", actionClose); actionCollection()->setDefaultShortcut(actionClose, Qt::CTRL + Qt::Key_Less); QAction *actionAssignDTD = new QAction(i18n("Assign Meta &DTD..."), this); - connect(actionAssignDTD, SIGNAL(triggered()), &m_model, SLOT(getDTD())); + connect(actionAssignDTD, &QAction::triggered, &m_model, &PluginKateXMLToolsCompletionModel::getDTD); actionCollection()->addAction("xml_tool_assign", actionAssignDTD); mainWin->guiFactory()->addClient(this); - connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentDeleted(KTextEditor::Document *)), - &m_model, SLOT(slotDocumentDeleted(KTextEditor::Document *))); + connect(KTextEditor::Editor::instance()->application(), &KTextEditor::Application::documentDeleted, + &m_model, &PluginKateXMLToolsCompletionModel::slotDocumentDeleted); } PluginKateXMLToolsView::~PluginKateXMLToolsView() @@ -477,9 +477,9 @@ QGuiApplication::setOverrideCursor(Qt::WaitCursor); KIO::Job *job = KIO::get(url); - connect(job, SIGNAL(result(KJob *)), this, SLOT(slotFinished(KJob *))); + connect(job, &KIO::Job::result, this, &PluginKateXMLToolsCompletionModel::slotFinished); connect(job, SIGNAL(data(KIO::Job *, QByteArray)), - this, SLOT(slotData(KIO::Job *, QByteArray))); + this, SLOT(slotData(KIO::Job *, QByteArray))); } qDebug() << "XMLTools::getDTD: Documents: " << m_docDtds.count() << ", DTDs: " << m_dtds.count(); } @@ -1073,17 +1073,16 @@ // combo box m_cmbElements = new KHistoryComboBox(this); static_cast(m_cmbElements)->setHistoryItems(completions, true); - connect(m_cmbElements->lineEdit(), SIGNAL(textChanged(QString)), - this, SLOT(slotHistoryTextChanged(QString))); + connect(m_cmbElements->lineEdit(), &QLineEdit::textChanged, this, &InsertElement::slotHistoryTextChanged); // button box QDialogButtonBox * box = new QDialogButtonBox(this); box->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); m_okButton = box->button(QDialogButtonBox::Ok); m_okButton->setDefault(true); - connect(box, SIGNAL(accepted()), this, SLOT(accept())); - connect(box, SIGNAL(rejected()), this, SLOT(reject())); + connect(box, &QDialogButtonBox::accepted, this, &InsertElement::accept); + connect(box, &QDialogButtonBox::rejected, this, &InsertElement::reject); // fill layout topLayout->addWidget(label);