QMimeData *DndFactory::createMimeData( Incidence *incidence ) { CalendarLocal cal( d->mCalendar->timeSpec() ); Incidence *i = incidence->clone(); cal.addIncidence( i ); QMimeData *mimeData = new QMimeData; ICalDrag::populateMimeData( mimeData, &cal ); VCalDrag::populateMimeData( mimeData, &cal ); KUrl uri = i->uri(); if ( uri.isValid() ) { QMap<QString, QString> metadata; metadata["labels"] = KUrl::toPercentEncoding( i->summary() ); uri.populateMimeData( mimeData, metadata ); } return mimeData; }
QMimeData *DndFactory::createMimeData( const Incidence::Ptr &incidence ) { MemoryCalendar::Ptr cal( new MemoryCalendar( d->mCalendar->timeSpec() ) ); Incidence::Ptr i( incidence->clone() ); cal->addIncidence( i ); QMimeData *mimeData = new QMimeData; ICalDrag::populateMimeData( mimeData, cal ); VCalDrag::populateMimeData( mimeData, cal ); KUrl uri = i->uri(); if ( uri.isValid() ) { QMap<QString, QString> metadata; metadata["labels"] = KUrl::toPercentEncoding( i->summary() ); uri.populateMimeData( mimeData, metadata ); } return mimeData; }