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)
KActionCollection* actions = new KActionCollection(this);
KStandardAction::selectAll(mListView, SLOT(selectAll()), actions);
KStandardAction::deselect(mListView, SLOT(clearSelection()), actions);
KStandardAction::selectAll(mListView, &QTreeView::selectAll, actions);
KStandardAction::deselect(mListView, &QTreeView::clearSelection, actions);
actions->addAssociatedWidget(mListView);
const auto lstActions = actions->actions();
for (QAction* action : lstActions)
......
......@@ -104,9 +104,9 @@ TemplateDlg::TemplateDlg(QWidget* parent)
topLayout->addWidget(buttonBox);
KActionCollection* actions = new KActionCollection(this);
QAction* act = KStandardAction::selectAll(mListView, SLOT(selectAll()), actions);
QAction* act = KStandardAction::selectAll(mListView, &QTreeView::selectAll, actions);
topLevelWidget()->addAction(act);
act = KStandardAction::deselect(mListView, SLOT(clearSelection()), actions);
act = KStandardAction::deselect(mListView, &QAbstractItemView::clearSelection, actions);
topLevelWidget()->addAction(act);
slotSelectionChanged(); // enable/disable buttons as appropriate
......
......@@ -84,14 +84,14 @@ TrayWindow::TrayWindow(MainWindow* parent)
addAction(QStringLiteral("tSpread"), a);
contextMenu()->addAction(a);
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,
// if the main window is hidden.
// Disable standard quit behaviour. We have to intercept the quit event
// (which triggers KStatusNotifierItem to quit unconditionally).
QAction* act = action(QStringLiteral("quit"));
if (act)
{
act->disconnect(SIGNAL(triggered(bool)), this, SLOT(maybeQuit()));
disconnect(act, &QAction::triggered, this, nullptr);
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