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

List:       kde-commits
Subject:    KDE/kdepim/akonadi/agents
From:       Volker Krause <vkrause () kde ! org>
Date:       2009-09-28 9:38:04
Message-ID: 1254130684.465899.12956.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1028821 by vkrause:

Index parent/child relations between items and collections.


 M  +3 -0      nepomuk_calendar_feeder/nepomukcalendarfeeder.cpp  
 M  +2 -0      nepomuk_contact_feeder/nepomukcontactfeeder.cpp  
 M  +1 -0      nepomuk_email_feeder/nepomukemailfeeder.cpp  
 M  +10 -0     nepomukfeeder/nepomukfeederagent.h  
 M  +2 -1      nepomukfeeder/nepomukfeederagentbase.cpp  


--- trunk/KDE/kdepim/akonadi/agents/nepomuk_calendar_feeder/nepomukcalendarfeeder.cpp \
#1028820:1028821 @@ -115,6 +115,7 @@
 {
   // create event with the graph reference
   NepomukFast::Event event( item.url(), graphUri );
+  setParent( event, item );
   updateIncidenceItem( calEvent, event, graphUri );
 
   QUrl uri;
@@ -176,12 +177,14 @@
 {
     // create journal entry with the graph reference
     NepomukFast::Journal journal( item.url(), graphUri );
+    setParent( journal, item );
     updateIncidenceItem( calJournal, journal, graphUri );
 }
 
 void NepomukCalendarFeeder::updateTodoItem( const Akonadi::Item &item, const \
KCal::Todo::Ptr &calTodo, const QUrl &graphUri )  {
   NepomukFast::Todo todo( item.url(), graphUri );
+  setParent( todo, item );
   updateIncidenceItem( calTodo, todo, graphUri );
 }
 
--- trunk/KDE/kdepim/akonadi/agents/nepomuk_contact_feeder/nepomukcontactfeeder.cpp \
#1028820:1028821 @@ -90,6 +90,7 @@
 {
   // create the contact with the graph reference
   NepomukFast::PersonContact contact( item.url(), graphUri );
+  setParent( contact, item );
 
   const KABC::Addressee addressee = item.payload<KABC::Addressee>();
 
@@ -240,6 +241,7 @@
 {
   // create the contact group with the graph reference
   NepomukFast::ContactGroup group( item.url(), graphUri );
+  setParent( group, item );
 
   const KABC::ContactGroup contactGroup = item.payload<KABC::ContactGroup>();
 
--- trunk/KDE/kdepim/akonadi/agents/nepomuk_email_feeder/nepomukemailfeeder.cpp \
#1028820:1028821 @@ -66,6 +66,7 @@
 
   // FIXME: make a distinction between email and news
   NepomukFast::Email r( item.url(), graphUri );
+  setParent( r, item );
 
   if ( msg->subject( false ) ) {
     r.setMessageSubject( msg->subject()->asUnicodeString() );
--- trunk/KDE/kdepim/akonadi/agents/nepomukfeeder/nepomukfeederagent.h \
#1028820:1028821 @@ -22,6 +22,8 @@
 
 #include "nepomukfeederagentbase.h"
 
+#include "nie.h"
+#include <akonadi/collection.h>
 #include <akonadi/entitydisplayattribute.h>
 #include <Soprano/Vocabulary/NAO>
 
@@ -42,7 +44,15 @@
         r.setLabel( collection.name() );
       if ( attr && !attr->iconName().isEmpty() )
         r.addProperty( Soprano::Vocabulary::NAO::hasSymbol(), Soprano::LiteralValue( \
attr->iconName() ) ); +      setParent( r, collection );
     }
+
+    template <typename R, typename E>
+    void setParent( R& res, const E &entity )
+    {
+      if ( entity.parentCollection().isValid() && entity.parentCollection() != \
Akonadi::Collection::root() ) +        res.addProperty( Vocabulary::NIE::isPartOf(), \
entity.parentCollection().url() ); +    }
 };
 
 #endif
--- trunk/KDE/kdepim/akonadi/agents/nepomukfeeder/nepomukfeederagentbase.cpp \
#1028820:1028821 @@ -204,8 +204,9 @@
 void NepomukFeederAgentBase::itemsReceived(const Akonadi::Item::List& items)
 {
   kDebug() << items.size();
-  foreach ( const Item &item, items ) {
+  foreach ( Item item, items ) {
     // we only get here if the item is not anywhere in Nepomuk yet, so no need to \
delete it +    item.setParentCollection( mCurrentCollection );
     updateItem( item, createGraphForEntity( item ) );
   }
   mProcessedAmount += items.count();


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

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