Commit f7f2e351 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Any apps can generate this mimedata (old code from kde 3.x)

parent 121f9fcd
Pipeline #23694 passed with stage
in 9 minutes and 13 seconds
......@@ -30,8 +30,6 @@
#include "knotes-version.h"
#include <Libkdepim/MaillistDrag>
using namespace KPIM;
using namespace KCalUtils;
using namespace KCalendarCore;
......@@ -120,7 +118,6 @@ bool KNotesPlugin::canDecodeMimeData(const QMimeData *mimeData) const
{
return
mimeData->hasText()
|| MailList::canDecode(mimeData)
|| KContacts::VCardDrag::canDecode(mimeData)
|| ICalDrag::canDecode(mimeData);
}
......@@ -178,23 +175,6 @@ void KNotesPlugin::processDropEvent(QDropEvent *event)
return;
}
if (MailList::canDecode(md)) {
MailList mails = MailList::fromMimeData(md);
event->accept();
if (mails.count() != 1) {
KMessageBox::sorry(
core(),
i18nc("@info", "Dropping multiple mails is not supported."));
} else {
MailSummary mail = mails.constFirst();
const QString txt = i18nc("@item", "From: %1\nTo: %2\nSubject: %3",
mail.from(), mail.to(), mail.subject());
static_cast<KNotesPart *>(part())->newNote(
i18nc("@item", "Mail: %1", mail.subject()), txt);
}
return;
}
qCWarning(KNOTES_KONTACT_PLUGIN_LOG) << QStringLiteral("Cannot handle drop events of type '%1'.").arg(event->mimeData()->formats().join(QLatin1Char(';')));
}
......
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