Commit 27fa5b2a authored by Laurent Montel's avatar Laurent Montel 😁

Use new connect api

parent 8381baa3
......@@ -68,8 +68,8 @@ MainWindow::MainWindow(QWidget *parent)
// set the shell's ui resource file
setXMLFile(QStringLiteral("akregator_shell.rc"));
KStandardAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); // options_configure_keybinding
KStandardAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); // options_configure_toolbars
KStandardAction::keyBindings(this, &MainWindow::optionsConfigureKeys, actionCollection()); // options_configure_keybinding
KStandardAction::configureToolbars(this, &MainWindow::optionsConfigureToolbars, actionCollection()); // options_configure_toolbars
toolBar()->show();
statusBar()->show();
......
......@@ -98,20 +98,20 @@ void ThemeEditorMainWindow::setupActions()
mUploadTheme = KNS3::standardAction(i18n("Upload theme..."), this, SLOT(slotUploadTheme()), actionCollection(), "upload_theme");
mNewThemeAction = KStandardAction::openNew(this, SLOT(slotNewTheme()), actionCollection());
mNewThemeAction = KStandardAction::openNew(this, &ThemeEditorMainWindow::slotNewTheme, actionCollection());
mNewThemeAction->setText(i18n("New theme..."));
mOpenAction = KStandardAction::open(this, SLOT(slotOpenTheme()), actionCollection());
mOpenAction = KStandardAction::open(this, &ThemeEditorMainWindow::slotOpenTheme, actionCollection());
mOpenAction->setText(i18n("Open theme..."));
mSaveAction = KStandardAction::save(this, SLOT(slotSaveTheme()), actionCollection());
mSaveAction = KStandardAction::save(this, &ThemeEditorMainWindow::slotSaveTheme, actionCollection());
mSaveAction->setText(i18n("Save theme..."));
mSaveAsAction = KStandardAction::saveAs(this, SLOT(slotSaveAsTheme()), actionCollection());
mSaveAsAction = KStandardAction::saveAs(this, &ThemeEditorMainWindow::slotSaveAsTheme, actionCollection());
mSaveAsAction->setText(i18n("Save theme as..."));
mCloseAction = KStandardAction::close(this, SLOT(slotCloseTheme()), actionCollection());
KStandardAction::quit(this, SLOT(slotQuitApp()), actionCollection());
KStandardAction::preferences(this, SLOT(slotConfigure()), actionCollection());
mCloseAction = KStandardAction::close(this, &ThemeEditorMainWindow::slotCloseTheme, actionCollection());
KStandardAction::quit(this, &ThemeEditorMainWindow::slotQuitApp, actionCollection());
KStandardAction::preferences(this, &ThemeEditorMainWindow::slotConfigure, actionCollection());
mInstallTheme = new QAction(i18n("Install theme"), this);
actionCollection()->addAction(QStringLiteral("install_theme"), mInstallTheme);
......
......@@ -96,19 +96,19 @@ void ContactEditorMainWindow::setupActions()
mUploadTheme = KNS3::standardAction(i18n("Upload theme..."), this, SLOT(slotUploadTheme()), actionCollection(), "upload_theme");
mNewThemeAction = KStandardAction::openNew(this, SLOT(slotNewTheme()), actionCollection());
mNewThemeAction = KStandardAction::openNew(this, &ContactEditorMainWindow::slotNewTheme, actionCollection());
mNewThemeAction->setText(i18n("New theme..."));
mOpenAction = KStandardAction::open(this, SLOT(slotOpenTheme()), actionCollection());
mOpenAction = KStandardAction::open(this, &ContactEditorMainWindow::slotOpenTheme, actionCollection());
mOpenAction->setText(i18n("Open theme..."));
mSaveAction = KStandardAction::save(this, SLOT(slotSaveTheme()), actionCollection());
mSaveAction = KStandardAction::save(this, &ContactEditorMainWindow::slotSaveTheme, actionCollection());
mSaveAction->setText(i18n("Save theme..."));
mSaveAsAction = KStandardAction::saveAs(this, SLOT(slotSaveAsTheme()), actionCollection());
mSaveAsAction = KStandardAction::saveAs(this, &ContactEditorMainWindow::slotSaveAsTheme, actionCollection());
mSaveAsAction->setText(i18n("Save theme as..."));
mCloseAction = KStandardAction::close(this, SLOT(slotCloseTheme()), actionCollection());
KStandardAction::quit(this, SLOT(slotQuitApp()), actionCollection());
KStandardAction::preferences(this, SLOT(slotConfigure()), actionCollection());
mCloseAction = KStandardAction::close(this, &ContactEditorMainWindow::slotCloseTheme, actionCollection());
KStandardAction::quit(this, &ContactEditorMainWindow::slotQuitApp, actionCollection());
KStandardAction::preferences(this, &ContactEditorMainWindow::slotConfigure, actionCollection());
mInstallTheme = new QAction(i18n("Install theme"), this);
actionCollection()->addAction(QStringLiteral("install_theme"), mInstallTheme);
......
......@@ -99,20 +99,20 @@ void ThemeEditorMainWindow::setupActions()
mUploadTheme = KNS3::standardAction(i18n("Upload theme..."), this, SLOT(slotUploadTheme()), actionCollection(), "upload_theme");
mNewThemeAction = KStandardAction::openNew(this, SLOT(slotNewTheme()), actionCollection());
mNewThemeAction = KStandardAction::openNew(this, &ThemeEditorMainWindow::slotNewTheme, actionCollection());
mNewThemeAction->setText(i18n("New theme..."));
mOpenAction = KStandardAction::open(this, SLOT(slotOpenTheme()), actionCollection());
mOpenAction = KStandardAction::open(this, &ThemeEditorMainWindow::slotOpenTheme, actionCollection());
mOpenAction->setText(i18n("Open theme..."));
mSaveAction = KStandardAction::save(this, SLOT(slotSaveTheme()), actionCollection());
mSaveAction = KStandardAction::save(this, &ThemeEditorMainWindow::slotSaveTheme, actionCollection());
mSaveAction->setText(i18n("Save theme..."));
mSaveAsAction = KStandardAction::saveAs(this, SLOT(slotSaveAsTheme()), actionCollection());
mSaveAsAction = KStandardAction::saveAs(this, &ThemeEditorMainWindow::slotSaveAsTheme, actionCollection());
mSaveAsAction->setText(i18n("Save theme as..."));
mCloseAction = KStandardAction::close(this, SLOT(slotCloseTheme()), actionCollection());
KStandardAction::quit(this, SLOT(slotQuitApp()), actionCollection());
KStandardAction::preferences(this, SLOT(slotConfigure()), actionCollection());
mCloseAction = KStandardAction::close(this, &ThemeEditorMainWindow::slotCloseTheme, actionCollection());
KStandardAction::quit(this, &ThemeEditorMainWindow::slotQuitApp, actionCollection());
KStandardAction::preferences(this, &ThemeEditorMainWindow::slotConfigure, actionCollection());
mInstallTheme = new QAction(i18n("Install theme"), this);
actionCollection()->addAction(QStringLiteral("install_theme"), mInstallTheme);
......
......@@ -596,12 +596,12 @@ void MainWidget::setupActions(KActionCollection *collection)
mGrantleeThemeManager->setThemeMenu(themeMenu);
mGrantleeThemeManager->setActionGroup(group);
QAction *action = KStandardAction::print(this, SLOT(print()), collection);
QAction *action = KStandardAction::print(this, &MainWidget::print, collection);
action->setWhatsThis(
i18nc("@info:whatsthis",
"Print the complete address book or a selected number of contacts."));
KStandardAction::printPreview(this, SLOT(printPreview()), collection);
KStandardAction::printPreview(this, &MainWidget::printPreview, collection);
QWidgetAction *quicksearch = new QWidgetAction(this);
quicksearch->setText(i18n("Quick search"));
......
......@@ -66,17 +66,17 @@ MainWidget *MainWindow::mainWidget() const
void MainWindow::initActions()
{
KStandardAction::quit(this, SLOT(close()), actionCollection());
KStandardAction::quit(this, &MainWindow::close, actionCollection());
mHideMenuBarAction = KStandardAction::showMenubar(this, SLOT(slotToggleMenubar()), actionCollection());
QAction *action =
KStandardAction::keyBindings(this, SLOT(configureKeyBindings()), actionCollection());
KStandardAction::keyBindings(this, &MainWindow::configureKeyBindings, actionCollection());
action->setWhatsThis(
i18nc("@info:whatsthis",
"You will be presented with a dialog where you can configure "
"the application-wide shortcuts."));
KStandardAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection());
KStandardAction::preferences(this, SLOT(configure()), actionCollection());
KStandardAction::configureToolbars(this, &MainWindow::configureToolbars, actionCollection());
KStandardAction::preferences(this, &MainWindow::configure, actionCollection());
}
void MainWindow::configure()
......
......@@ -1243,8 +1243,8 @@ void KMComposerWin::setupActions(void)
setStandardToolBarMenuEnabled(true);
KStandardAction::keyBindings(this, SLOT(slotEditKeys()), actionCollection());
KStandardAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection());
KStandardAction::keyBindings(this, &KMComposerWin::slotEditKeys, actionCollection());
KStandardAction::configureToolbars(this, &KMComposerWin::slotEditToolbars, actionCollection());
KStandardAction::preferences(kmkernel, SLOT(slotShowConfigurationDialog()), actionCollection());
action = new QAction(i18n("&Spellchecker..."), this);
......
......@@ -2846,10 +2846,10 @@ void KMMainWidget::setupActions()
connect(mSaveAsAction, &QAction::triggered, this, &KMMainWidget::slotSaveMsg);
actionCollection()->setDefaultShortcut(mSaveAsAction, KStandardShortcut::save().first());
mOpenAction = KStandardAction::open(this, SLOT(slotOpenMsg()),
mOpenAction = KStandardAction::open(this, &KMMainWidget::slotOpenMsg,
actionCollection());
mOpenRecentAction = KStandardAction::openRecent(this, SLOT(slotOpenRecentMsg(QUrl)),
mOpenRecentAction = KStandardAction::openRecent(this, &KMMainWidget::slotOpenRecentMsg,
actionCollection());
KConfigGroup grp = mConfig->group(QStringLiteral("Recent Files"));
mOpenRecentAction->loadEntries(grp);
......
......@@ -67,15 +67,15 @@ KMMainWin::KMMainWin(QWidget *)
}
setStandardToolBarMenuEnabled(true);
KStandardAction::configureToolbars(this, SLOT(slotEditToolbars()),
KStandardAction::configureToolbars(this, &KMMainWin::slotEditToolbars,
actionCollection());
KStandardAction::keyBindings(this, SLOT(slotConfigureShortcuts()),
KStandardAction::keyBindings(this, &KMMainWin::slotConfigureShortcuts,
actionCollection());
mHideMenuBarAction = KStandardAction::showMenubar(this, SLOT(slotToggleMenubar()), actionCollection());
mHideMenuBarAction = KStandardAction::showMenubar(this, &KMMainWin::slotToggleMenubar, actionCollection());
KStandardAction::quit(this, SLOT(slotQuit()), actionCollection());
KStandardAction::quit(this, &KMMainWin::slotQuit, actionCollection());
createGUI(QStringLiteral("kmmainwin.rc"));
//must be after createGUI, otherwise e.g toolbar settings are not loaded
......
......@@ -364,7 +364,7 @@ void KMReaderMainWin::setupAccel()
actionCollection()->setDefaultShortcut(mTrashAction, QKeySequence(Qt::Key_Delete));
connect(mTrashAction, &QAction::triggered, this, &KMReaderMainWin::slotTrashMessage);
QAction *closeAction = KStandardAction::close(this, SLOT(close()), actionCollection());
QAction *closeAction = KStandardAction::close(this, &KMReaderMainWin::close, actionCollection());
QList<QKeySequence> closeShortcut = closeAction->shortcuts();
closeAction->setShortcuts(closeShortcut << QKeySequence(Qt::Key_Escape));
......@@ -374,7 +374,7 @@ void KMReaderMainWin::setupAccel()
connect(mReaderWin->viewer(), &MessageViewer::Viewer::itemRemoved, this, &QWidget::close);
setStandardToolBarMenuEnabled(true);
KStandardAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection());
KStandardAction::configureToolbars(this, &KMReaderMainWin::slotEditToolbars, actionCollection());
connect(mReaderWin->viewer(), &MessageViewer::Viewer::moveMessageToTrash, this, &KMReaderMainWin::slotTrashMessage);
connect(mReaderWin->viewer(), &MessageViewer::Viewer::executeMailAction, this, &KMReaderMainWin::slotExecuteMailAction);
}
......
......@@ -158,7 +158,7 @@ KNotesApp::KNotesApp()
#endif
KStandardAction::preferences(this, SLOT(slotPreferences()),
actionCollection());
KStandardAction::keyBindings(this, SLOT(slotConfigureAccels()),
KStandardAction::keyBindings(this, &KNotesApp::slotConfigureAccels,
actionCollection());
//FIXME: no shortcut removing!?
KStandardAction::quit(this, SLOT(slotQuit()),
......
......@@ -209,7 +209,7 @@ KNotesPart::KNotesPart(QObject *parent)
connect(mReadOnly, &KToggleAction::triggered, this, &KNotesPart::slotUpdateReadOnly);
mReadOnly->setCheckedState(KGuiItem(i18n("Unlock"), QStringLiteral("object-unlocked")));
KStandardAction::find(this, SLOT(slotOpenFindDialog()), actionCollection());
KStandardAction::find(this, &KNotesPart::slotOpenFindDialog, actionCollection());
Akonadi::Session *session = new Akonadi::Session("KNotes Session", this);
mNoteRecorder = new NoteShared::NotesChangeRecorder(this);
......
......@@ -177,8 +177,8 @@ void MainWindow::initGUI()
KHelpMenu *helpMenu = new KHelpMenu(this, QString(), true/*, actionCollection() QT5*/);
connect(helpMenu, &KHelpMenu::showAboutApplication, this, &MainWindow::showAboutDialog);
KStandardAction::keyBindings(this, SLOT(configureShortcuts()), actionCollection());
KStandardAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection());
KStandardAction::keyBindings(this, &MainWindow::configureShortcuts, actionCollection());
KStandardAction::configureToolbars(this, &MainWindow::configureToolbars, actionCollection());
setXMLFile(QStringLiteral("kontactui.rc"));
setStandardToolBarMenuEnabled(true);
......
......@@ -159,9 +159,9 @@ void KOrganizer::initActions()
setStandardToolBarMenuEnabled(true);
createStandardStatusBarAction();
KStandardAction::keyBindings(this, SLOT(slotEditKeys()), actionCollection());
KStandardAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection());
KStandardAction::quit(this, SLOT(close()), actionCollection());
KStandardAction::keyBindings(this, &KOrganizer::slotEditKeys, actionCollection());
KStandardAction::configureToolbars(this, &KOrganizer::configureToolbars, actionCollection());
KStandardAction::quit(this, &KOrganizer::close, actionCollection());
setXMLFile(QStringLiteral("korganizerui.rc"), true);
createGUI(Q_NULLPTR);
......
......@@ -92,21 +92,21 @@ KTNEFMain::~KTNEFMain()
void KTNEFMain::setupActions()
{
KStandardAction::quit(this, SLOT(close()), actionCollection());
KStandardAction::quit(this, &KTNEFMain::close, actionCollection());
QAction *action =
KStandardAction::keyBindings(this, SLOT(slotConfigureKeys()), actionCollection());
KStandardAction::keyBindings(this, &KTNEFMain::slotConfigureKeys, actionCollection());
action->setWhatsThis(
i18nc("@info:whatsthis",
"You will be presented with a dialog where you can configure "
"the application-wide shortcuts."));
KStandardAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection());
KStandardAction::configureToolbars(this, &KTNEFMain::slotEditToolbars, actionCollection());
// File menu
KStandardAction::open(this, SLOT(openFile()), actionCollection());
KStandardAction::open(this, &KTNEFMain::openFile, actionCollection());
mOpenRecentFileAction = KStandardAction::openRecent(this, SLOT(openRecentFile(QUrl)), actionCollection());
mOpenRecentFileAction = KStandardAction::openRecent(this, &KTNEFMain::openRecentFile, actionCollection());
// Action menu
QAction *openAction = actionCollection()->addAction(QStringLiteral("view_file"));
......
......@@ -218,13 +218,13 @@ void PimSettingExporterWindow::setupActions(bool canZipFile)
mShowArchiveInformationsAboutCurrentArchiveAction->setEnabled(false);
KStandardAction::quit(this, SLOT(close()), ac);
mRecentFilesAction = KStandardAction::openRecent(this, SLOT(slotRestoreFile(QUrl)), ac);
mRecentFilesAction = KStandardAction::openRecent(this, &PimSettingExporterWindow::slotRestoreFile, ac);
KSharedConfig::Ptr config = KSharedConfig::openConfig();
KConfigGroup groupConfig = config->group(QStringLiteral("Recent File"));
mRecentFilesAction->loadEntries(groupConfig);
KStandardAction::preferences(this, SLOT(slotConfigure()), ac);
KStandardAction::preferences(this, &PimSettingExporterWindow::slotConfigure, ac);
}
void PimSettingExporterWindow::slotConfigure()
......
......@@ -118,10 +118,10 @@ void SieveEditorMainWindow::setupActions()
{
KActionCollection *ac = actionCollection();
KStandardAction::quit(this, SLOT(close()), ac);
KStandardAction::preferences(this, SLOT(slotConfigure()), ac);
KStandardAction::quit(this, &SieveEditorMainWindow::close, ac);
KStandardAction::preferences(this, &SieveEditorMainWindow::slotConfigure, ac);
mUploadScript = KStandardAction::save(this, SLOT(slotUploadScript()), ac);
mUploadScript = KStandardAction::save(this, &SieveEditorMainWindow::slotUploadScript, ac);
mUploadScript->setText(i18n("Upload"));
mUploadScript->setEnabled(false);
......
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