diff --git a/editor/kmcomposereditor.cpp b/editor/kmcomposereditor.cpp index 790f773aa..141905922 100644 --- a/editor/kmcomposereditor.cpp +++ b/editor/kmcomposereditor.cpp @@ -49,6 +49,7 @@ #include #include #include +#include using namespace MailCommon; @@ -62,27 +63,32 @@ KMComposerEditor::~KMComposerEditor() { } -void KMComposerEditor::createActions( KActionCollection *actionCollection ) +QList KMComposerEditor::createActions() { - //QT5 KMeditor::createActions( actionCollection ); + QList lstAction = KMeditor::createActions(); - KAction *pasteQuotation = new KAction( i18n("Pa&ste as Quotation"), this ); - actionCollection->addAction(QLatin1String("paste_quoted"), pasteQuotation ); + QAction *pasteQuotation = new QAction( i18n("Pa&ste as Quotation"), this ); + pasteQuotation->setObjectName(QLatin1String("paste_quoted")); pasteQuotation->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_O)); connect( pasteQuotation, SIGNAL(triggered(bool)), this, SLOT(slotPasteAsQuotation()) ); + lstAction.append(pasteQuotation); - KAction *addQuoteChars = new KAction( i18n("Add &Quote Characters"), this ); - actionCollection->addAction( QLatin1String("tools_quote"), addQuoteChars ); + QAction *addQuoteChars = new QAction( i18n("Add &Quote Characters"), this ); + addQuoteChars->setObjectName(QLatin1String("tools_quote")); connect( addQuoteChars, SIGNAL(triggered(bool)), this, SLOT(slotAddQuotes()) ); + lstAction.append(addQuoteChars); - KAction *remQuoteChars = new KAction( i18n("Re&move Quote Characters"), this ); - actionCollection->addAction( QLatin1String("tools_unquote"), remQuoteChars ); + QAction *remQuoteChars = new QAction( i18n("Re&move Quote Characters"), this ); + remQuoteChars->setObjectName(QLatin1String("tools_unquote")); connect (remQuoteChars, SIGNAL(triggered(bool)), this, SLOT(slotRemoveQuotes()) ); + lstAction.append(remQuoteChars); - KAction *pasteWithoutFormatting = new KAction( i18n("Paste Without Formatting"), this ); - actionCollection->addAction( QLatin1String("paste_without_formatting"), pasteWithoutFormatting ); + QAction *pasteWithoutFormatting = new QAction( i18n("Paste Without Formatting"), this ); + pasteWithoutFormatting->setObjectName(QLatin1String("paste_without_formatting")); pasteWithoutFormatting->setShortcut(QKeySequence(Qt::CTRL+Qt::SHIFT+Qt::Key_V)); connect (pasteWithoutFormatting, SIGNAL(triggered(bool)), this, SLOT(slotPasteWithoutFormatting()) ); + lstAction.append(pasteWithoutFormatting); + return lstAction; } void KMComposerEditor::setHighlighterColors(KPIMTextEdit::EMailQuoteHighlighter * highlighter) diff --git a/editor/kmcomposereditor.h b/editor/kmcomposereditor.h index ccd515903..2d844e279 100644 --- a/editor/kmcomposereditor.h +++ b/editor/kmcomposereditor.h @@ -48,7 +48,7 @@ public: * - tools_quote * - tools_unquote */ - void createActions( KActionCollection *actionCollection ); + virtual QList createActions(); /** * This replaces all characters not known to the specified codec with diff --git a/editor/kmcomposewin.cpp b/editor/kmcomposewin.cpp index fc8a300e1..8283241ee 100644 --- a/editor/kmcomposewin.cpp +++ b/editor/kmcomposewin.cpp @@ -1425,7 +1425,7 @@ void KMComposeWin::setupActions( void ) mCryptoModuleAction->setItems( l ); mCryptoModuleAction->setToolTip( i18n( "Select a cryptographic format for this message" ) ); - //QT5 mComposerBase->editor()->createActions( actionCollection() ); + actionCollection()->addActions(mComposerBase->editor()->createActions()); actionCollection()->addAction( QLatin1String("shared_link"), KMKernel::self()->storageServiceManager()->menuShareLinkServices(this) ); createGUI( QLatin1String("kmcomposerui.rc") );