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

This interface doesn't exist now. We need to port it

svn path=/trunk/KDE/kdepim/kontact/plugins/; revision=1158349
parent 72e45f70
......@@ -30,10 +30,8 @@
#include <libkdepim/maillistdrag.h>
#include <KABC/VCardDrag>
#include <kcalcore/incidence.h>
#include <kcalcore/memorycalendar.h>
#include <kcalutils/icaldrag.h>
#include <KCal/CalendarLocal>
#include <KCal/ICalDrag>
#include <KontactInterface/Core>
......@@ -150,12 +148,16 @@ void KOrganizerPlugin::slotNewEvent()
void KOrganizerPlugin::slotSyncEvents()
{
#if 0
QDBusMessage message =
QDBusMessage::createMethodCall( "org.kde.kmail", "/Groupware",
"org.kde.kmail.groupware",
"triggerSync" );
message << QString( "Calendar" );
QDBusConnection::sessionBus().send( message );
#else
kWarning()<<" KOrganizerPlugin::slotSyncEvents : need to port to Akonadi";
#endif
}
bool KOrganizerPlugin::createDBUSInterface( const QString &serviceType )
......@@ -205,16 +207,16 @@ void KOrganizerPlugin::processDropEvent( QDropEvent *event )
return;
}
if ( KCalUtils::ICalDrag::canDecode( event->mimeData() ) ) {
KCalCore::MemoryCalendar::Ptr cal( new KCalCore::MemoryCalendar( KSystemTimeZones::local() ) );
if ( KCalUtils::ICalDrag::fromMimeData( event->mimeData(), cal ) ) {
KCalCore::Incidence::List incidences = cal->incidences();
if ( KCal::ICalDrag::canDecode( event->mimeData() ) ) {
KCal::CalendarLocal cal( KSystemTimeZones::local() );
if ( KCal::ICalDrag::fromMimeData( event->mimeData(), &cal ) ) {
KCal::Incidence::List incidences = cal.incidences();
Q_ASSERT( incidences.count() );
if ( !incidences.isEmpty() ) {
event->accept();
KCalCore::Incidence::Ptr i = incidences.first();
KCal::Incidence *i = incidences.first();
QString summary;
if ( i->type() == KCalCore::Incidence::TypeJournal ) {
if ( dynamic_cast<KCal::Journal*>( i ) ) {
summary = i18nc( "@item", "Note: %1", i->summary() );
} else {
summary = i->summary();
......
......@@ -30,9 +30,8 @@
#include <libkdepim/maillistdrag.h>
#include <KABC/VCardDrag>
#include <kcalcore/memorycalendar.h>
#include <kcalutils/icaldrag.h>
#include <KCal/CalendarLocal>
#include <KCal/ICalDrag>
#include <KontactInterface/Core>
......@@ -151,12 +150,16 @@ void TodoPlugin::slotNewTodo()
void TodoPlugin::slotSyncTodos()
{
#if 0
QDBusMessage message =
QDBusMessage::createMethodCall( "org.kde.kmail", "/Groupware",
"org.kde.kmail.groupware",
"triggerSync" );
message << QString( "Todo" );
QDBusConnection::sessionBus().send( message );
#else
kWarning()<<" TodoPlugin::slotSyncTodos : need to port to Akonadi";
#endif
}
bool TodoPlugin::createDBUSInterface( const QString &serviceType )
......@@ -175,7 +178,7 @@ bool TodoPlugin::canDecodeMimeData( const QMimeData *mimeData ) const
mimeData->hasText() ||
KPIM::MailList::canDecode( mimeData ) ||
KABC::VCardDrag::canDecode( mimeData ) ||
KCalUtils::ICalDrag::canDecode( mimeData );
KCal::ICalDrag::canDecode( mimeData );
}
bool TodoPlugin::isRunningStandalone() const
......@@ -209,16 +212,16 @@ void TodoPlugin::processDropEvent( QDropEvent *event )
return;
}
if ( KCalUtils::ICalDrag::canDecode( event->mimeData() ) ) {
KCalCore::MemoryCalendar::Ptr cal( new KCalCore::MemoryCalendar( KSystemTimeZones::local() ) );
if ( KCalUtils::ICalDrag::fromMimeData( event->mimeData(), cal ) ) {
KCalCore::Incidence::List incidences = cal->incidences();
if ( KCal::ICalDrag::canDecode( event->mimeData() ) ) {
KCal::CalendarLocal cal( KSystemTimeZones::local() );
if ( KCal::ICalDrag::fromMimeData( event->mimeData(), &cal ) ) {
KCal::Incidence::List incidences = cal.incidences();
Q_ASSERT( incidences.count() );
if ( !incidences.isEmpty() ) {
event->accept();
KCalCore::Incidence::Ptr i = incidences.first();
KCal::Incidence *i = incidences.first();
QString summary;
if ( i->type() == KCalCore::Incidence::TypeJournal ) {
if ( dynamic_cast<KCal::Journal*>( i ) ) {
summary = i18nc( "@item", "Note: %1", i->summary() );
} else {
summary = i->summary();
......
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