Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e29db6ef authored by Elvis Angelaccio's avatar Elvis Angelaccio

Drop some more SLOT() usages

KActionCollection is missing the addAction() overload that we would need to
get rid of the SLOT() arguments.

So we create the actions via KStandardAction, and then we add them later
to the action collection.
parent bcc1ca6c
......@@ -172,10 +172,12 @@ bool MainWindow::loadPart()
void MainWindow::setupActions()
{
m_newAction = actionCollection()->addAction(KStandardAction::New, QStringLiteral("ark_file_new"), this, SLOT(newArchive()));
m_openAction = actionCollection()->addAction(KStandardAction::Open, QStringLiteral("ark_file_open"), this, SLOT(openArchive()));
actionCollection()->addAction(KStandardAction::Quit, QStringLiteral("ark_quit"), this, SLOT(quit()));
m_newAction = KStandardAction::openNew(this, &MainWindow::newArchive, nullptr);
actionCollection()->addAction(QStringLiteral("ark_file_new"), m_newAction);
m_openAction = KStandardAction::open(this, &MainWindow::openArchive, nullptr);
actionCollection()->addAction(QStringLiteral("ark_file_open"), m_openAction);
auto quitAction = KStandardAction::quit(this, &MainWindow::quit, nullptr);
actionCollection()->addAction(QStringLiteral("ark_quit"), quitAction);
m_recentFilesAction = KStandardAction::openRecent(this, &MainWindow::openUrl, nullptr);
actionCollection()->addAction(QStringLiteral("ark_file_open_recent"), m_recentFilesAction);
......
......@@ -361,7 +361,8 @@ void Part::setupActions()
connect(m_showInfoPanelAction, &QAction::triggered,
this, &Part::slotToggleInfoPanel);
m_saveAsAction = actionCollection()->addAction(KStandardAction::SaveAs, QStringLiteral("ark_file_save_as"), this, SLOT(slotSaveAs()));
m_saveAsAction = KStandardAction::saveAs(this, &Part::slotSaveAs, nullptr);
actionCollection()->addAction(QStringLiteral("ark_file_save_as"), m_saveAsAction);
m_openFileAction = actionCollection()->addAction(QStringLiteral("openfile"));
m_openFileAction->setText(i18nc("open a file with external program", "&Open"));
......
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