File Fix-bug-403317.patch of Package kdepim-addons
From 32b4086c7ccfcddba01fe6d852bef8cf4fec9bff Mon Sep 17 00:00:00 2001
From: Laurent Montel <montel@kde.org>
Date: Tue, 30 Apr 2019 14:00:50 +0200
Subject: Fix Bug 403317 - KMAIL2; "Share Text" plugin segfaults
BUG: 403317
---
.../sharetext/sharetextplugineditorinterface.cpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kmail/editorplugins/sharetext/sharetextplugineditorinterface.cpp b/kmail/editorplugins/sharetext/sharetextplugineditorinterface.cpp
index d44f815..e293cad 100644
--- a/kmail/editorplugins/sharetext/sharetextplugineditorinterface.cpp
+++ b/kmail/editorplugins/sharetext/sharetextplugineditorinterface.cpp
@@ -40,16 +40,16 @@ ShareTextPluginEditorInterface::~ShareTextPluginEditorInterface()
void ShareTextPluginEditorInterface::createAction(KActionCollection *ac)
{
SharetextPurposeMenuWidget *purposeMenu = new SharetextPurposeMenuWidget(parentWidget(), this);
+ QAction *shareAction = new QAction(i18n("Share Mail Text..."), this);
+ shareAction->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
+ ac->addAction(QStringLiteral("share_text_menu"), shareAction);
+ purposeMenu->setEditorWidget(this);
+ MessageComposer::PluginActionType type(shareAction, MessageComposer::PluginActionType::File);
+ setActionType(type);
if (purposeMenu->menu()) {
- QAction *shareAction = new QAction(i18n("Share Mail Text..."), this);
shareAction->setMenu(purposeMenu->menu());
- shareAction->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
- ac->addAction(QStringLiteral("share_text_menu"), shareAction);
- purposeMenu->setEditorWidget(this);
- MessageComposer::PluginActionType type(shareAction, MessageComposer::PluginActionType::File);
- setActionType(type);
} else {
- delete purposeMenu;
+ shareAction->setEnabled(false);
}
}
--
cgit v1.1