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

List:       kde-commits
Subject:    KDE/kdebase/runtime/nepomuk/strigibackend
From:       Sebastian Trueg <sebastian () trueg ! de>
Date:       2008-11-20 11:00:10
Message-ID: 1227178810.363415.15838.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 886855 by trueg:

Use libnepomuk instead of having our own class to access the storage

 M  +2 -2      CMakeLists.txt  
 D             nepomukmainmodel.cpp  
 D             nepomukmainmodel.h  
 M  +8 -13     sopranoindexmanager.cpp  
 M  +1 -5      sopranoindexmanager.h  
 M  +0 -3      sopranoindexwriter.cpp  


--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/CMakeLists.txt #886854:886855
@@ -13,7 +13,6 @@
   sopranoindexwriter.cpp
   util.cpp
   tstring.cpp
-  nepomukmainmodel.cpp
 )
 
 # CLucene requires exception support
@@ -38,9 +37,10 @@
 
 target_link_libraries(sopranobackend
   ${STRIGI_STREAMANALYZER_LIBRARY}
+  ${NEPOMUK_LIBRARIES}
   ${SOPRANO_LIBRARIES}
+  ${SOPRANO_CLIENT_LIBRARIES}
   ${SOPRANO_INDEX_LIBRARIES}
-  ${SOPRANO_CLIENT_LIBRARIES}
   ${QT_QTCORE_LIBRARY}
   ${CLUCENE_LIBRARY}
   ${KDE4_KDECORE_LIBS}
--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexmanager.cpp \
#886854:886855 @@ -20,7 +20,6 @@
 #include "sopranoindexmanager.h"
 #include "sopranoindexwriter.h"
 #include "sopranoindexreader.h"
-#include "nepomukmainmodel.h"
 
 #include <strigi/strigiconfig.h>
 
@@ -35,17 +34,17 @@
 #include <QtCore/QDebug>
 #include <QtCore/QString>
 
+#include <Nepomuk/ResourceManager>
 
+
 class Strigi::Soprano::IndexManager::Private
 {
 public:
     Private()
-        : repository( 0 ),
-          writer( 0 ),
+        : writer( 0 ),
           reader( 0 ) {
     }
 
-    ::Soprano::Model* repository;
     IndexWriter* writer;
     IndexReader* reader;
 };
@@ -55,12 +54,10 @@
 // we do not use REGISTER_STRIGI_INDEXMANAGER as we do have to perform some \
additional checks  STRIGI_EXPORT Strigi::IndexManager* createIndexManager( const \
char* )  {
-    Nepomuk::MainModel* model = new Nepomuk::MainModel();
-    if( model->isValid() ) {
-        return new Strigi::Soprano::IndexManager( model );
+    if( Nepomuk::ResourceManager::instance()->init() == 0 ) {
+        return new Strigi::Soprano::IndexManager();
     }
     else {
-        delete model;
         return 0;
     }
 }
@@ -71,10 +68,9 @@
 }
 }
 
-Strigi::Soprano::IndexManager::IndexManager( ::Soprano::Model* model )
+Strigi::Soprano::IndexManager::IndexManager()
 {
     d = new Private;
-    d->repository = model;
 }
 
 
@@ -83,7 +79,6 @@
     qDebug() << "Cleaning up SopranoIndexManager";
     delete d->reader;
     delete d->writer;
-    delete d->repository;
     delete d;
 }
 
@@ -92,7 +87,7 @@
 {
     if ( !d->reader ) {
         qDebug() << "(Soprano::IndexManager) creating IndexReader";
-        d->reader = new Strigi::Soprano::IndexReader( d->repository );
+        d->reader = new Strigi::Soprano::IndexReader( \
Nepomuk::ResourceManager::instance()->mainModel() );  }
 
     return d->reader;
@@ -103,7 +98,7 @@
 {
     if ( !d->writer ) {
         qDebug() << "(Soprano::IndexManager) creating IndexWriter";
-        d->writer = new Strigi::Soprano::IndexWriter( d->repository );
+        d->writer = new Strigi::Soprano::IndexWriter( \
Nepomuk::ResourceManager::instance()->mainModel() );  }
 
     return d->writer;
--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexmanager.h \
#886854:886855 @@ -24,10 +24,6 @@
 
 class QString;
 
-namespace Soprano {
-    class Model;
-}
-
 namespace Strigi {
 
     class IndexReader;
@@ -37,7 +33,7 @@
         class IndexManager : public Strigi::IndexManager
         {
         public:
-            IndexManager( ::Soprano::Model* );
+            IndexManager();
             ~IndexManager();
 
             Strigi::IndexReader* indexReader();
--- trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexwriter.cpp \
#886854:886855 @@ -21,8 +21,6 @@
 #include "util.h"
 
 #include <Soprano/Soprano>
-#include <Soprano/Index/IndexFilterModel>
-#include <Soprano/Index/CLuceneIndex>
 #include <Soprano/Vocabulary/RDF>
 #include <Soprano/Vocabulary/Xesam>
 #include <Soprano/LiteralValue>
@@ -171,7 +169,6 @@
         }
     }
 
-//    ::Soprano::Index::IndexFilterModel* repository;
     ::Soprano::Model* repository;
     int indexTransactionID;
 


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

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