Commit 429141e2 authored by David Jarvie's avatar David Jarvie
Browse files

Use member function syntax for disconnect and KStandardAction connect

parent 013ec1fe
Pipeline #37575 passed with stage
in 20 minutes and 1 second
...@@ -229,8 +229,8 @@ BirthdayDlg::BirthdayDlg(QWidget* parent) ...@@ -229,8 +229,8 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
KActionCollection* actions = new KActionCollection(this); KActionCollection* actions = new KActionCollection(this);
KStandardAction::selectAll(mListView, SLOT(selectAll()), actions); KStandardAction::selectAll(mListView, &QTreeView::selectAll, actions);
KStandardAction::deselect(mListView, SLOT(clearSelection()), actions); KStandardAction::deselect(mListView, &QTreeView::clearSelection, actions);
actions->addAssociatedWidget(mListView); actions->addAssociatedWidget(mListView);
const auto lstActions = actions->actions(); const auto lstActions = actions->actions();
for (QAction* action : lstActions) for (QAction* action : lstActions)
......
...@@ -104,9 +104,9 @@ TemplateDlg::TemplateDlg(QWidget* parent) ...@@ -104,9 +104,9 @@ TemplateDlg::TemplateDlg(QWidget* parent)
topLayout->addWidget(buttonBox); topLayout->addWidget(buttonBox);
KActionCollection* actions = new KActionCollection(this); KActionCollection* actions = new KActionCollection(this);
QAction* act = KStandardAction::selectAll(mListView, SLOT(selectAll()), actions); QAction* act = KStandardAction::selectAll(mListView, &QTreeView::selectAll, actions);
topLevelWidget()->addAction(act); topLevelWidget()->addAction(act);
act = KStandardAction::deselect(mListView, SLOT(clearSelection()), actions); act = KStandardAction::deselect(mListView, &QAbstractItemView::clearSelection, actions);
topLevelWidget()->addAction(act); topLevelWidget()->addAction(act);
slotSelectionChanged(); // enable/disable buttons as appropriate slotSelectionChanged(); // enable/disable buttons as appropriate
......
...@@ -84,14 +84,14 @@ TrayWindow::TrayWindow(MainWindow* parent) ...@@ -84,14 +84,14 @@ TrayWindow::TrayWindow(MainWindow* parent)
addAction(QStringLiteral("tSpread"), a); addAction(QStringLiteral("tSpread"), a);
contextMenu()->addAction(a); contextMenu()->addAction(a);
contextMenu()->addSeparator(); contextMenu()->addSeparator();
contextMenu()->addAction(KStandardAction::preferences(this, SLOT(slotPreferences()), this)); contextMenu()->addAction(KStandardAction::preferences(this, &TrayWindow::slotPreferences, this));
// Disable standard quit behaviour. We have to intercept the quit even, // Disable standard quit behaviour. We have to intercept the quit event
// if the main window is hidden. // (which triggers KStatusNotifierItem to quit unconditionally).
QAction* act = action(QStringLiteral("quit")); QAction* act = action(QStringLiteral("quit"));
if (act) if (act)
{ {
act->disconnect(SIGNAL(triggered(bool)), this, SLOT(maybeQuit())); disconnect(act, &QAction::triggered, this, nullptr);
connect(act, &QAction::triggered, this, &TrayWindow::slotQuit); connect(act, &QAction::triggered, this, &TrayWindow::slotQuit);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment