[Kde-pim] Dragging akonadi items

Robin Atwood robin at binro.org
Wed Feb 24 12:39:04 GMT 2010


On Wednesday 24 February 2010, Tobias Koenig wrote:
> On Wed, Feb 24, 2010 at 05:45:26PM +0700, Robin Atwood wrote:
> > On Sunday 21 February 2010, Ingo Klöcker wrote:
> Hej Robin,
> 
> > > The only problem is that KPIM::KVCardDrag lives in kdepim/libkdepim,
> > > i.e. it's not public API. If you want to use it outside or kdepim you
> > > might have to copy it.
> > 
> > I have been playing around with this and I think just copying over
> > KVcardDrag doesn't cut it.
> 
> No, KVCardDrag is not supposed to work with Akonadi out-of-the-box.
> 
> When you drag an item from an Akonadi based view (e.g. from new
> KAddressBook or the ported KMail/KOrganizer), then the url inside the drag
> object looks like
> 
>  akonadi:?item=123&mimetype=text/directory
> 
> So it does not contain any real data, only a reference to the Akonadi item
> you refer to. To get the actual data, you have to start a
> Akonadi::ItemFetchJob.
> 
>   KUrl url = ... // extract url from drag object
> 
>   Akonadi::Item item = Akonadi::Item::fromUrl( url );
> 
>   Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( item );
>   job->fetchScope()->fullPayload();
>   connect( job, SIGNAL( result( KJob* ) ), SLOT( fetchedItem( KJob* ) ) );

Thanks, Tobias, all is now much clearer. 

-Robin
-- 
----------------------------------------------------------------------
Robin Atwood.

"Ship me somewheres east of Suez, where the best is like the worst,
 Where there ain't no Ten Commandments an' a man can raise a thirst"
         from "Mandalay" by Rudyard Kipling
----------------------------------------------------------------------








_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list