Commit 9b6925d2 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

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

parent 8a58558d
Pipeline #23695 passed with stage
in 18 minutes and 7 seconds
......@@ -27,8 +27,6 @@
#include "calendarinterface.h"
#include "korg_uniqueapp.h"
#include <Libkdepim/MaillistDrag>
#include <KContacts/VCardDrag>
#include <KCalendarCore/Incidence>
......@@ -139,7 +137,6 @@ bool KOrganizerPlugin::isRunningStandalone() const
bool KOrganizerPlugin::canDecodeMimeData(const QMimeData *mimeData) const
{
return mimeData->hasText()
|| KPIM::MailList::canDecode(mimeData)
|| KContacts::VCardDrag::canDecode(mimeData);
}
......@@ -198,30 +195,6 @@ void KOrganizerPlugin::processDropEvent(QDropEvent *event)
return;
}
if (KPIM::MailList::canDecode(md)) {
KPIM::MailList mails = KPIM::MailList::fromMimeData(md);
event->accept();
if (mails.count() != 1) {
KMessageBox::sorry(
core(),
i18nc("@info", "Dropping multiple mails is not supported."));
} else {
KPIM::MailSummary mail = mails.first();
QString txt = i18nc("@item", "From: %1\nTo: %2\nSubject: %3",
mail.from(), mail.to(), mail.subject());
QTemporaryFile tf;
tf.setAutoRemove(true);
tf.open();
QString uri = QLatin1String("kmail:") + QString::number(mail.serialNumber());
tf.write(event->mimeData()->data(QStringLiteral("message/rfc822")));
interface()->openEventEditor(
i18nc("@item", "Mail: %1", mail.subject()), txt,
uri, tf.fileName(), QStringList(), QStringLiteral("message/rfc822"));
tf.close();
}
return;
}
qCWarning(KORGANIZERPLUGIN_LOG)
<< QStringLiteral("Cannot handle drop events of type '%1'.").arg(
event->mimeData()->formats().join(QLatin1Char(';')));
......
......@@ -27,8 +27,6 @@
#include "korg_uniqueapp.h"
#include "todosummarywidget.h"
#include <Libkdepim/MaillistDrag>
#include <KContacts/VCardDrag>
#include <KCalendarCore/MemoryCalendar>
......@@ -141,7 +139,6 @@ bool TodoPlugin::canDecodeMimeData(const QMimeData *mimeData) const
{
return
mimeData->hasText()
|| KPIM::MailList::canDecode(mimeData)
|| KContacts::VCardDrag::canDecode(mimeData)
|| KCalUtils::ICalDrag::canDecode(mimeData);
}
......@@ -205,31 +202,6 @@ void TodoPlugin::processDropEvent(QDropEvent *event)
return;
}
if (KPIM::MailList::canDecode(md)) {
KPIM::MailList mails = KPIM::MailList::fromMimeData(md);
event->accept();
if (mails.count() != 1) {
KMessageBox::sorry(
core(),
i18nc("@info", "Dropping multiple mails is not supported."));
} else {
KPIM::MailSummary mail = mails.at(0);
QString txt = i18nc("@item", "From: %1\nTo: %2\nSubject: %3",
mail.from(), mail.to(), mail.subject());
QString uri = QStringLiteral("kmail:")
+QString::number(mail.serialNumber()) + QLatin1Char('/')
+mail.messageId();
QTemporaryFile tf;
tf.setAutoRemove(true);
tf.write(event->mimeData()->data(QStringLiteral("message/rfc822")));
interface()->openTodoEditor(
i18nc("@item", "Mail: %1", mail.subject()),
txt, uri, tf.fileName(), QStringList(), QStringLiteral("message/rfc822"));
tf.close();
}
return;
}
qCWarning(KORGANIZERPLUGIN_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