Commit d91680fd authored by Laurent Montel's avatar Laurent Montel 😁

Remove dead code

parent bc816138
......@@ -151,7 +151,6 @@ set(libmessageviewer_antispam_SRCS
)
set(libmessageviewer_job_SRCS
job/attachmenteditjob.cpp
job/modifymessagedisplayformatjob.cpp
)
......
......@@ -74,10 +74,6 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<label>Reduce font size for quoted text</label>
<whatsthis>Enable this option to show quoted text with a smaller font.</whatsthis>
</entry>
<entry name="AllowAttachmentEditing" type="Bool">
<default>false</default>
<label>Allow to edit attachments of existing mails.</label>
</entry>
<entry name="AlwaysDecrypt" type="Bool">
<default>false</default>
<label>Always decrypt messages when viewing or ask before decrypting</label>
......
......@@ -137,7 +137,6 @@ public:
Save = 4,
Properties = 5,
Delete = 6,
Edit = 7,
Copy = 8,
ScrollTo = 9,
ReplyMessageToAuthor = 10,
......
......@@ -37,7 +37,6 @@
#include "kpimtextedit/slidecontainer.h"
#include <Gravatar/GravatarCache>
#include <gravatar/gravatarsettings.h>
#include "job/attachmenteditjob.h"
#include "job/modifymessagedisplayformatjob.h"
#include "config-messageviewer.h"
#include "webengine/mailwebenginescript.h"
......@@ -479,17 +478,6 @@ void ViewerPrivate::itemModifiedResult(KJob *job)
}
}
void ViewerPrivate::editAttachment(KMime::Content *node, bool showWarning)
{
MessageViewer::AttachmentEditJob *job = new MessageViewer::AttachmentEditJob(mSession, this);
connect(job, &AttachmentEditJob::refreshMessage, this, &ViewerPrivate::slotRefreshMessage);
job->setMainWindow(mMainWindow);
job->setMessageItem(mMessageItem);
job->setMessage(mMessage);
job->addAttachment(node, showWarning);
job->canDeleteJob();
}
void ViewerPrivate::scrollToAnchor(const QString &anchor)
{
mViewer->scrollToAnchor(anchor);
......@@ -656,16 +644,6 @@ void ViewerPrivate::showAttachmentPopup(KMime::Content *node, const QString &nam
!= Akonadi::Collection::ReadOnly)
&& !isEncapsulatedMessage;
if (MessageViewer::MessageViewerSettings::self()->allowAttachmentEditing()) {
action
= menu.addAction(QIcon::fromTheme(QStringLiteral("document-properties")), i18n(
"Edit Attachment"));
connect(action, &QAction::triggered, this, [this]() {
slotHandleAttachment(Viewer::Edit);
});
action->setEnabled(canChange);
}
action
= menu.addAction(QIcon::fromTheme(QStringLiteral("edit-delete")),
i18n("Delete Attachment"));
......@@ -1822,11 +1800,6 @@ void ViewerPrivate::showContextMenu(KMime::Content *content, const QPoint &pos)
popup.addAction(QIcon::fromTheme("edit-delete"), i18n("Delete Attachment"),
this, &ViewerPrivate::slotAttachmentDelete);
#endif
if (MessageViewer::MessageViewerSettings::self()->allowAttachmentEditing()) {
popup.addAction(QIcon::fromTheme(QStringLiteral("document-properties")),
i18n("Edit Attachment"),
this, &ViewerPrivate::slotAttachmentEdit);
}
}
if (!content->isTopLevel()) {
......@@ -2704,29 +2677,6 @@ void ViewerPrivate::slotAttachmentDelete()
update();
}
void ViewerPrivate::slotAttachmentEdit()
{
const auto contents = selectedContents();
if (contents.isEmpty()) {
return;
}
MessageViewer::AttachmentEditJob *job = new MessageViewer::AttachmentEditJob(mSession, this);
connect(job, &AttachmentEditJob::refreshMessage, this, &ViewerPrivate::slotRefreshMessage);
job->setMainWindow(mMainWindow);
job->setMessageItem(mMessageItem);
job->setMessage(mMessage);
bool showWarning = true;
for (KMime::Content *content : contents) {
if (!job->addAttachment(content, showWarning)) {
break;
}
showWarning = false;
}
job->canDeleteJob();
}
void ViewerPrivate::slotLevelQuote(int l)
{
if (mLevelQuote != l) {
......@@ -2744,9 +2694,6 @@ void ViewerPrivate::slotHandleAttachment(int choice)
case Viewer::Delete:
deleteAttachment(mCurrentContent);
break;
case Viewer::Edit:
editAttachment(mCurrentContent);
break;
case Viewer::Properties:
attachmentProperties(mCurrentContent);
break;
......
......@@ -218,10 +218,6 @@ public:
void attachmentProperties(KMime::Content *node);
void attachmentCopy(const KMime::Content::List &contents);
/** Edit the attachment the @param node points to. Returns false if the user
cancelled the editing, true in all other cases! */
void editAttachment(KMime::Content *node, bool showWarning = true);
void scrollToAnchor(const QString &anchor);
void showAttachmentPopup(KMime::Content *node, const QString &name, const QPoint &p);
......@@ -528,7 +524,6 @@ public Q_SLOTS:
void slotAttachmentProperties();
void slotAttachmentCopy();
void slotAttachmentDelete();
void slotAttachmentEdit();
void slotLevelQuote(int l);
/** Toggle display mode between HTML and plain text. */
......
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