2 Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this library; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #include "sopranoindexmanager.h"
21 #include "sopranoindexwriter.h"
22 #include "sopranoindexreader.h"
24 #include <strigi/strigiconfig.h>
26 #include <Soprano/Client/DBusClient>
27 #include <Soprano/Index/IndexFilterModel>
28 #include <Soprano/Index/CLuceneIndex>
29 #include <Soprano/Util/MutexModel>
30 #include <Soprano/Client/DBusModel>
31 #include <Soprano/Client/LocalSocketClient>
33 #include <QtCore/QDir>
34 #include <QtCore/QDebug>
35 #include <QtCore/QString>
37 #include <Nepomuk/ResourceManager>
40 class Strigi::Soprano::IndexManager::Private
54 // we do not use REGISTER_STRIGI_INDEXMANAGER as we do have to perform some additional checks
55 STRIGI_EXPORT
Strigi::IndexManager
* createIndexManager( const char* )
57 if( Nepomuk::ResourceManager::instance()->init() == 0 ) {
58 return new Strigi::Soprano::IndexManager();
65 STRIGI_EXPORT
void deleteIndexManager( Strigi::IndexManager
* m
)
71 Strigi::Soprano::IndexManager::IndexManager()
77 Strigi::Soprano::IndexManager::~IndexManager()
79 qDebug() << "Cleaning up SopranoIndexManager";
86 Strigi::IndexReader
* Strigi::Soprano::IndexManager::indexReader()
89 qDebug() << "(Soprano::IndexManager) creating IndexReader";
90 d
->reader
= new Strigi::Soprano::IndexReader( Nepomuk::ResourceManager::instance()->mainModel() );
97 Strigi::IndexWriter
* Strigi::Soprano::IndexManager::indexWriter()
100 qDebug() << "(Soprano::IndexManager) creating IndexWriter";
101 d
->writer
= new Strigi::Soprano::IndexWriter( Nepomuk::ResourceManager::instance()->mainModel() );