[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdepim/akonadi/agents
From:       Sebastian =?iso-8859-1?q?Tr=FCg?= <trueg () kde ! org>
Date:       2009-09-22 13:24:42
Message-ID: 200909221524.42533.trueg () kde ! org
[Download RAW message or body]

On Tuesday 22 September 2009 14:00:17 Volker Krause wrote:
> On Wednesday 16 September 2009 17:18:37 Sebastian Trüg wrote:
> > On Wednesday 16 September 2009 16:30:33 Volker Krause wrote:
> > > On Wednesday 16 September 2009 16:27:25 Sebastian Trüg wrote:
> > > > On Wednesday 16 September 2009 15:54:22 Volker Krause wrote:
> > > > > +void NepomukFeederAgent::tagsFromCategories(NepomukFast::Resource&
> > > > >  resource, const QStringList& categories) +{
> > > > > +  // FIXME: this voids the usage of the XFast classes...
> > > > > +  Nepomuk::Resource res( resource.uri() );
> > > > > +  foreach ( const QString &category, categories ) {
> > > > > +    const Nepomuk::Tag tag( category );
> > > > > +    res.addTag( tag );
> > > > > +  }
> > > > > +}
> > > >
> > > > better do this:
> > > > resource.setProperty( Soprano::Vocabulary::NAO::hasTag(),
> > > > tag.resourceUri() );
> > >
> > > tried that already, but NepomukFast::Resource has no method
> > > setProperty().
> >
> > that is easy to add. We can do that in Berlin maybe.
>
> my mistake, there is addProperty(), which seems to do the right thing.
>
> However, there is a much larger problem here, related to the usage of the
> NepomukFast classes: They require a delete + add approach when updating
> information in Nepomuk for changed Akonadi items. However, this will lose
> additional information that have been added to the corresponding Nepomuk
> resource in the meantime, such as tags.

actually you don't. The idea is to delete only the graph that has been created 
for the fast classes instead of the whole resource.
I just checked. That is exactly that is already being done in 
NepomukFeederAgent::removeItemFromNepomuk. Thus, if the resource URI stays the 
same (which I was told it did in Akonadi) there is no problem.

Cheers,
Sebastian

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic