Commit 1651d3da authored by Lays Rodrigues's avatar Lays Rodrigues 😀

Update Signals&Slots of Addons

Summary:
Update most of the connections of all files inside addons
folder to qt5 pattern.
Signed-off-by: Lays Rodrigues's avatarLays Rodrigues <laysrodriguessilva@gmail.com>

Reviewers: cullmann kfunk

Tags: #kate

Differential Revision: https://phabricator.kde.org/D7851
parent 2e7cb245
......@@ -41,6 +41,7 @@
#include <QClipboard>
#include <QDialogButtonBox>
#include <QUrl>
#include <QTreeWidget>
//END Includes
K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();)
......@@ -138,8 +139,7 @@ KateBtBrowserPluginView::KateBtBrowserPluginView(KateBtBrowserPlugin *plugin, KT
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 @@ KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QW
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 @@ KateBtConfigWidget::KateBtConfigWidget(QWidget *parent)
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 @@ KateBtConfigDialog::KateBtConfigDialog(QWidget *parent)
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()
......
......@@ -95,10 +95,10 @@ CloseConfirmDialog::CloseConfirmDialog(
// 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
......
......@@ -109,28 +109,15 @@ CloseExceptPluginView::CloseExceptPluginView(
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::documentCreated(KTextEditor::Editor*, KTextEditor::D
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 @@ void CloseExceptPluginView::appendActionsFrom(
QString action = path.path() + QLatin1Char('*');
actions[action] = QPointer<QAction>(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<void (QSignalMapper::*)()>(&QSignalMapper::map));
mapper->setMapping(actions[action], action);
}
}
......@@ -211,7 +188,8 @@ void CloseExceptPluginView::appendActionsFrom(
QString action = mask.startsWith(QLatin1Char('*')) ? mask : mask + QLatin1Char('*');
actions[action] = QPointer<QAction>(new QAction(action, menu));
menu->addAction(actions[action]);
connect(actions[action], SIGNAL(triggered()), mapper, SLOT(map()));
connect(actions[action], &QAction::triggered,
mapper, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
mapper->setMapping(actions[action], action);
}
}
......@@ -299,8 +277,10 @@ void CloseExceptPluginView::updateMenu()
//
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<void (QSignalMapper::*)(const QString&)>(&QSignalMapper::mapped),
this, &CloseExceptPluginView::closeExcept);
connect(m_like_mapper, static_cast<void (QSignalMapper::*)(const QString&)>(&QSignalMapper::mapped),
this, &CloseExceptPluginView::closeLike);
}
}
......
......@@ -70,7 +70,7 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow,
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 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow,
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<void (KDirOperator::*)()>(&KDirOperator::setFocus));
// now all actions exist in dir operator and we can use them in the toolbar
setupActions();
setupToolbar();
......@@ -99,24 +99,21 @@ KateFileBrowser::KateFileBrowser(KTextEditor::MainWindow *mainWindow,
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<void (KHistoryComboBox::*)(const QString &)>(&KHistoryComboBox::returnPressed),
m_filter, &KHistoryComboBox::addToHistory);
connect(m_filter, static_cast<void (KHistoryComboBox::*)(const QString &)>(&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<void (KateFileBrowser::*)(const QString&)>(&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 @@ void KateFileBrowser::setupActions()
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 @@ void KateFileBrowser::setupActions()
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);
......
......@@ -85,10 +85,10 @@ KateFileBrowserConfigPage::KateFileBrowserConfigPage( QWidget *parent, KateFileB
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 );
......
......@@ -43,7 +43,7 @@ KateFileBrowserPlugin::KateFileBrowserPlugin(QObject* parent, const QList<QVaria
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;
}
......
......@@ -60,32 +60,32 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
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 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
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 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
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 @@ void KateFileTree::contextMenuEvent(QContextMenuEvent *event)
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);
......
......@@ -125,12 +125,14 @@ KateFileTreeConfigPage::KateFileTreeConfigPage(QWidget *parent, KateFileTreePlug
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<void (KComboBox::*)(int)>(&KComboBox::activated),
this, &KateFileTreeConfigPage::slotMyChanged);
connect(cmbMode, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated),
this, &KateFileTreeConfigPage::slotMyChanged);
connect(cbShowFullPath, &QCheckBox::stateChanged, this, &KateFileTreeConfigPage::slotMyChanged);
}
QString KateFileTreeConfigPage::name() const
......
......@@ -462,9 +462,9 @@ void KateFileTreeModel::clearModel()
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::documentEdited(const KTextEditor::Document *doc)
void KateFileTreeModel::slotAboutToDeleteDocuments(const QList<KTextEditor::Document *> &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)));
}
......
......@@ -63,7 +63,7 @@ KateFileTreePlugin::~KateFileTreePlugin()
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 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
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,23 +164,28 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
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<KTextEditor::Document *>)),
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<KTextEditor::Document *>)),
this, SLOT(slotDocumentsCreated(const QList<KTextEditor::Document *> &)));
connect(KTextEditor::Editor::instance()->application(), SIGNAL(aboutToDeleteDocuments(const QList<KTextEditor::Document *> &)),
m_documentModel, SLOT(slotAboutToDeleteDocuments(const QList<KTextEditor::Document *> &)));
connect(KTextEditor::Editor::instance()->application(), SIGNAL(documentsDeleted(const QList<KTextEditor::Document *> &)),
m_documentModel, SLOT(slotDocumentsDeleted(const QList<KTextEditor::Document *> &)));
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);
......@@ -191,9 +194,10 @@ KateFileTreePluginView::KateFileTreePluginView(KTextEditor::MainWindow *mainWind
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 @@ void KateFileTreePluginView::setupActions()
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"));
......
......@@ -31,25 +31,25 @@ AdvancedGDBSettings::AdvancedGDBSettings(QWidget *parent) : QDialog(parent)
{
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<void (QComboBox::*)(int)>(&QComboBox::activated), this, &AdvancedGDBSettings::slotLocalRemoteChanged);
}
AdvancedGDBSettings::~AdvancedGDBSettings()
......
......@@ -116,15 +116,15 @@ ConfigView::ConfigView(QWidget* parent, KTextEditor::MainWindow* mainWin)
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<void (QComboBox::*)(int)>(&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 @@ void ConfigView::registerActions(KActionCollection* actionCollection)
{
m_targetSelectAction = actionCollection->add<KSelectAction>(QStringLiteral("targets"));
m_targetSelectAction->setText(i18n("Targets"));
connect(m_targetSelectAction, SIGNAL(triggered(int)),
this, SLOT(slotTargetSelected(int)));
connect(m_targetSelectAction, static_cast<void (KSelectAction::*)(int)>(&KSelectAction::triggered),
this, &ConfigView::slotTargetSelected);
}
void ConfigView::readConfig(const KConfigGroup& group)
......
......@@ -78,17 +78,17 @@ void DebugView::runDebugger(const GDBTargetConf &conf, const QStringList &ioFifo
//create a process to control GDB
m_debugProcess.setWorkingDirectory(m_targetConf.workDir);