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 654f9baa authored by Laurent Montel's avatar Laurent Montel 😁

Not allow to delete attachment (crash)

parent 766cba56
......@@ -1753,7 +1753,7 @@ void ViewerPrivate::createActions()
ac->setDefaultShortcut(mFindInMessageAction, KStandardShortcut::find().first());
}
void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos, bool allowToDelete)
{
#ifndef QT_NO_TREEVIEW
if (!content) {
......@@ -1801,13 +1801,15 @@ void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
if (isAttachment) {
popup.addAction(QIcon::fromTheme(QStringLiteral("edit-copy")), i18n("Copy"),
this, &ViewerPrivate::slotAttachmentCopy);
#if 0 //FIXME Laurent Comment for the moment it crash see Bug 287177
popup.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete Attachment"),
this, &ViewerPrivate::slotAttachmentDelete);
#endif
if (allowToDelete) {
//FIXME Laurent Comment for the moment it crash see Bug 287177
popup.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")), i18n("Delete Attachment"),
this, &ViewerPrivate::slotAttachmentDelete);
}
}
if (!content->isTopLevel()) {
popup.addSeparator();
popup.addAction(i18n("Properties"), this, &ViewerPrivate::slotAttachmentProperties);
}
}
......@@ -2511,7 +2513,7 @@ void ViewerPrivate::slotMimeTreeContextMenuRequested(const QPoint &pos)
QModelIndex index = mMimePartTree->indexAt(pos);
if (index.isValid()) {
KMime::Content *content = static_cast<KMime::Content *>(index.internalPointer());
showContextMenu(content, pos);
showContextMenu(content, pos, false);
}
#endif
}
......
......@@ -343,7 +343,7 @@ public:
void createWidgets();
void createActions();
void showContextMenu(KMime::Content *content, const QPoint &point);
void showContextMenu(KMime::Content *content, const QPoint &point, bool allowToDelete = true);
KToggleAction *actionForAttachmentStrategy(const AttachmentStrategy *);
/** Read override codec from configuration */
......
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