Connect actions to member function pointers instead of slot strings

parent 0dd18013
......@@ -94,7 +94,7 @@ namespace Konversation
m_popup->addSeparator(); // -----
m_open = m_popup->addAction(QIcon::fromTheme(QStringLiteral("system-run")), i18n("&Open File"), this, &TransferPanel::runDcc);
m_open->setStatusTip(i18n("Run the file"));
m_openLocation = m_popup->addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Open Location"), this, SLOT(openLocation()));
m_openLocation = m_popup->addAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Open Location"), this, QOverload<>::of(&TransferPanel::openLocation));
m_openLocation->setStatusTip(i18n("Open the file location"));
m_transferView->setContextMenuPolicy(Qt::CustomContextMenu);
......
......@@ -161,12 +161,12 @@ ChannelListPanel::ChannelListPanel(QWidget* parent) : ChatWindow(parent)
setSpacing(0);
m_toolBar = new KToolBar(this, true, true);
m_toolBar->setObjectName(QStringLiteral("channellistpanel_toolbar"));
m_saveList = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save list", "Save &List..."), this, SLOT(saveList()));
m_saveList = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save list", "Save &List..."), this, &ChannelListPanel::saveList);
m_saveList->setWhatsThis(i18n("Click here to save the channel list."));
m_refreshList = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("refresh list", "&Refresh List"), this, SLOT(refreshList()));
m_refreshList = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("refresh list", "&Refresh List"), this, &ChannelListPanel::refreshList);
m_refreshList->setWhatsThis(i18n("Click here to refresh the channel list."));
m_toolBar->addSeparator();
m_joinChannel = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("irc-join-channel")), i18nc("join channel", "&Join Channel"), this, SLOT(joinChannelClicked()));
m_joinChannel = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("irc-join-channel")), i18nc("join channel", "&Join Channel"), this, &ChannelListPanel::joinChannelClicked);
m_joinChannel->setWhatsThis(i18n("Click here to join the channel. A new tab is created for the channel."));
//UI Setup
setupUi(this);
......
......@@ -104,17 +104,17 @@ MainWindow::MainWindow() : KXmlGuiWindow(nullptr)
// Actions
KStandardAction::quit(this,SLOT(quitProgram()),actionCollection());
KStandardAction::quit(this, &MainWindow::quitProgram, actionCollection());
m_showMenuBarAction = KStandardAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection());
m_showMenuBarAction = KStandardAction::showMenubar(this, &MainWindow::toggleMenubar, actionCollection());
setStandardToolBarMenuEnabled(true);
KStandardAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection());
KStandardAction::configureToolbars(this, &MainWindow::configureToolbars, actionCollection());
KStandardAction::keyBindings(this, SLOT(openKeyBindings()), actionCollection());
KStandardAction::preferences(this, SLOT(openPrefsDialog()), actionCollection());
KStandardAction::keyBindings(this, &MainWindow::openKeyBindings, actionCollection());
KStandardAction::preferences(this, &MainWindow::openPrefsDialog, actionCollection());
KStandardAction::configureNotifications(this, SLOT(openNotifications()), actionCollection());
KStandardAction::configureNotifications(this, &MainWindow::openNotifications, actionCollection());
QAction* action;
......@@ -469,11 +469,11 @@ MainWindow::MainWindow() : KXmlGuiWindow(nullptr)
connect(action, &QAction::triggered, m_viewContainer, &ViewContainer::showJoinChannelDialog);
actionCollection()->addAction(QStringLiteral("join_channel"), action);
action = KStandardAction::find(m_viewContainer, SLOT(findText()), actionCollection());
action = KStandardAction::find(m_viewContainer, &ViewContainer::findText, actionCollection());
action->setEnabled(false);
action = KStandardAction::findNext(m_viewContainer, SLOT(findNextText()), actionCollection());
action = KStandardAction::findNext(m_viewContainer, &ViewContainer::findNextText, actionCollection());
action->setEnabled(false);
action = KStandardAction::findPrev(m_viewContainer, SLOT(findPrevText()), actionCollection());
action = KStandardAction::findPrev(m_viewContainer, &ViewContainer::findPrevText, actionCollection());
action->setEnabled(false);
action=new QAction(this);
......
......@@ -104,14 +104,14 @@ void UrlCatcher::setupActions()
QAction* action;
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("open url", "&Open"), this, SLOT(openSelectedUrls()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("window-new")), i18nc("open url", "&Open"), this, &UrlCatcher::openSelectedUrls);
m_itemActions.append(action);
m_contextMenu->addAction(action);
action->setStatusTip(i18n("Open URLs in external browser."));
action->setWhatsThis(i18n("<p>Select one or several <b>URLs</b> below, then click this button to launch the application associated with the mimetype of the URL.</p>-<p>In the <b>Settings</b>, under <b>Behavior</b> | <b>General</b>, you can specify a custom web browser for web URLs.</p>"));
action->setEnabled(false);
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("&Save..."), this, SLOT(saveSelectedUrls()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18n("&Save..."), this, &UrlCatcher::saveSelectedUrls);
m_itemActions.append(action);
m_contextMenu->addAction(action);
action->setStatusTip(i18n("Save selected URLs to the disk."));
......@@ -125,14 +125,14 @@ void UrlCatcher::setupActions()
m_toolBar->addSeparator();
m_contextMenu->addSeparator();
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("copy url","&Copy"), this, SLOT(copySelectedUrls()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18nc("copy url","&Copy"), this, &UrlCatcher::copySelectedUrls);
m_itemActions.append(action);
m_contextMenu->addAction(action);
action->setStatusTip(i18n("Copy URLs to the clipboard."));
action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to copy them to the clipboard."));
action->setEnabled(false);
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("delete url","&Delete"), this, SLOT(deleteSelectedUrls()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18nc("delete url","&Delete"), this, &UrlCatcher::deleteSelectedUrls);
m_itemActions.append(action);
m_contextMenu->addAction(action);
action->setWhatsThis(i18n("Select one or several <b>URLs</b> above, then click this button to delete them from the list."));
......@@ -142,13 +142,13 @@ void UrlCatcher::setupActions()
m_toolBar->addSeparator();
m_contextMenu->addSeparator();
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save url list", "&Save List..."), this, SLOT(saveUrlModel()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save")), i18nc("save url list", "&Save List..."), this, &UrlCatcher::saveUrlModel);
m_listActions.append(action);
action->setStatusTip(i18n("Save list."));
action->setWhatsThis(i18n("Click to save the entire list to a file."));
action->setEnabled(false);
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18nc("clear url list","&Clear List"), this, SLOT(clearUrlModel()));
action = m_toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-clear-list")), i18nc("clear url list","&Clear List"), this, &UrlCatcher::clearUrlModel);
m_listActions.append(action);
action->setStatusTip(i18n("Clear list."));
action->setWhatsThis(i18n("Click to erase the entire list."));
......
......@@ -43,9 +43,9 @@ LogfileReader::LogfileReader(QWidget* parent, const QString& log, const QString&
toolBar = new KToolBar(this, true, true);
toolBar->setObjectName(QStringLiteral("logfile_toolbar"));
toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save-as")), i18n("Save As..."), this, SLOT(saveLog()));
toolBar->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Reload"), this, SLOT(updateView()));
toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Clear Logfile"), this, SLOT(clearLog()));
toolBar->addAction(QIcon::fromTheme(QStringLiteral("document-save-as")), i18n("Save As..."), this, &LogfileReader::saveLog);
toolBar->addAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Reload"), this, &LogfileReader::updateView);
toolBar->addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Clear Logfile"), this, &LogfileReader::clearLog);
toolBar->addWidget(new QLabel(i18n("Show last:"),toolBar));
sizeSpin = new QSpinBox(toolBar);
......
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