rev 7603 - in kde-extras/strigi/trunk/debian: . patches

Fathi Boudra fboudra-guest at alioth.debian.org
Sat Oct 20 15:40:40 UTC 2007


Author: fboudra-guest
Date: 2007-10-20 15:40:40 +0000 (Sat, 20 Oct 2007)
New Revision: 7603

Added:
   kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r726017.diff
   kde-extras/strigi/trunk/debian/patches/series
   kde-extras/strigi/trunk/debian/strigi-index-plugins.install
Removed:
   kde-extras/strigi/trunk/debian/libcluceneindex-dev.install
   kde-extras/strigi/trunk/debian/libcluceneindex0.install
   kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r698697.diff
   kde-extras/strigi/trunk/debian/watch
Modified:
   kde-extras/strigi/trunk/debian/changelog
   kde-extras/strigi/trunk/debian/control
   kde-extras/strigi/trunk/debian/libstreamanalyzer-dev.install
   kde-extras/strigi/trunk/debian/libstreamanalyzer0.install
   kde-extras/strigi/trunk/debian/libstreams-dev.install
   kde-extras/strigi/trunk/debian/rules
Log:
Strigi WIP. Not finished yet because of new index plugins architecture.

  * New upstream release.
  * Add branch pull patch to r726017.
  * Add build dependencies: bison, libcppunit-dev, libexiv2-dev, libxml2-utils.
  * Update libstreamanalyzer* packages:
    * Add strigiea_jpeg plugin.
    * Replace fieldproperties/strigi_* by xesam.rdfs.
    * Add new include files.
  * Add new include files to libstreams-dev package.
  * Remove watch file. Upstream website is not always updated with the release.
  * Replace libcluceneindex* packages by strigi-index-plugins package.



Modified: kde-extras/strigi/trunk/debian/changelog
===================================================================
--- kde-extras/strigi/trunk/debian/changelog	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/changelog	2007-10-20 15:40:40 UTC (rev 7603)
@@ -1,3 +1,18 @@
+strigi (0.5.6-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+  * Add branch pull patch to r726017.
+  * Add build dependencies: bison, libcppunit-dev, libexiv2-dev, libxml2-utils.
+  * Update libstreamanalyzer* packages:
+    * Add strigiea_jpeg plugin.
+    * Replace fieldproperties/strigi_* by xesam.rdfs.
+    * Add new include files.
+  * Add new include files to libstreams-dev package.
+  * Remove watch file. Upstream website is not always updated with the release.
+  * Replace libcluceneindex* packages by strigi-index-plugins package.
+
+ -- Fathi Boudra <fboudra at free.fr>  Sat, 20 Oct 2007 14:57:40 +0200
+
 strigi (0.5.5-2) unstable; urgency=low
 
   * Add branch pull patch. Fixed call of endAnalysis(bool):

Modified: kde-extras/strigi/trunk/debian/control
===================================================================
--- kde-extras/strigi/trunk/debian/control	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/control	2007-10-20 15:40:40 UTC (rev 7603)
@@ -3,15 +3,17 @@
 Priority: optional
 Maintainer: Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org>
 Uploaders: Fathi Boudra <fboudra at free.fr>, Mark Purcell <msp at debian.org>
-Build-Depends: cdbs, debhelper (>= 5), cmake, libbz2-dev, libclucene-dev,
- zlib1g-dev, libattr1-dev, libxml2-dev, libqt4-dev, libdbus-1-dev, python,
- python-support
+Build-Depends: cdbs, debhelper (>= 5), cmake, quilt, bison,
+ libattr1-dev, libbz2-dev, libclucene-dev, libcppunit-dev, libdbus-1-dev,
+ libexiv2-dev, libqt4-dev, libxml2-dev, zlib1g-dev, libxml2-utils,
+ python-support, python
 Standards-Version: 3.7.2
 
 Package: strigi-daemon
 Architecture: any
 Section: utils
-Depends: ${shlibs:Depends}, ${misc:Depends}, poppler-utils, dbus-x11 | dbus
+Depends: ${shlibs:Depends}, ${misc:Depends}, poppler-utils, dbus-x11 | dbus,
+ strigi-index-plugins
 Suggests: strigi-plugins
 Description: fast indexing and searching tool for your personal data (daemon)
  Strigi is a program for fast indexing and searching your personal data. It can
@@ -203,26 +205,17 @@
  .
   Homepage: http://www.vandenoever.info/software/strigi
 
-Package: libcluceneindex0
+Package: strigi-index-plugins
 Architecture: any
 Section: libs
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: cluceneindex library for Strigi Desktop Search
- This package is part of Strigi Desktop Search, it contains a library for
- clucene indexer.
+Conflicts: libcluceneindex0 (<< 0.5.6-1), libcluceneindex-dev (<< 0.5.6-1)
+Replaces: libcluceneindex0 (<< 0.5.6-1), libcluceneindex-dev (<< 0.5.6-1)
+Description: index plugins for Strigi Desktop Search
+ This package is part of Strigi Desktop Search, it contains Strigi index plugins.
  .
- See the 'strigi-daemon' package for more informations.
+ It contains clucene index plugin only.
  .
-  Homepage: http://www.vandenoever.info/software/strigi
-
-Package: libcluceneindex-dev
-Architecture: any
-Section: libdevel
-Depends: libcluceneindex0 (= ${binary:Version})
-Description: development files for libsearchclient
- This package is part of Strigi Desktop Search, it contains the Strigi
- development files for libcluceneindex.
- .
  See the 'strigi-daemon' package for more informations.
  .
   Homepage: http://www.vandenoever.info/software/strigi

Deleted: kde-extras/strigi/trunk/debian/libcluceneindex-dev.install

Deleted: kde-extras/strigi/trunk/debian/libcluceneindex0.install

Modified: kde-extras/strigi/trunk/debian/libstreamanalyzer-dev.install
===================================================================
--- kde-extras/strigi/trunk/debian/libstreamanalyzer-dev.install	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/libstreamanalyzer-dev.install	2007-10-20 15:40:40 UTC (rev 7603)
@@ -5,6 +5,9 @@
 usr/include/strigi/fieldproperties.h
 usr/include/strigi/fieldtypes.h
 usr/include/strigi/indexeddocument.h
+usr/include/strigi/indexmanager.h
+usr/include/strigi/indexplugin.h
+usr/include/strigi/indexreader.h
 usr/include/strigi/indexwriter.h
 usr/include/strigi/streamanalyzer.h
 usr/include/strigi/streamanalyzerfactory.h

Modified: kde-extras/strigi/trunk/debian/libstreamanalyzer0.install
===================================================================
--- kde-extras/strigi/trunk/debian/libstreamanalyzer0.install	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/libstreamanalyzer0.install	2007-10-20 15:40:40 UTC (rev 7603)
@@ -1,4 +1,5 @@
 usr/lib/libstreamanalyzer.so.*
+usr/lib/strigi/strigiea_*
 usr/lib/strigi/strigila_*
 usr/lib/strigi/strigita_*
-usr/share/strigi/fieldproperties/strigi_*
+usr/share/strigi/fieldproperties/xesam.rdfs

Modified: kde-extras/strigi/trunk/debian/libstreams-dev.install
===================================================================
--- kde-extras/strigi/trunk/debian/libstreams-dev.install	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/libstreams-dev.install	2007-10-20 15:40:40 UTC (rev 7603)
@@ -4,9 +4,12 @@
 usr/include/strigi/fileinputstream.h
 usr/include/strigi/inputstream.h
 usr/include/strigi/inputstreamreader.h
+usr/include/strigi/sdfinputstream.h
+usr/include/strigi/stringterminatedsubstream.h
 usr/include/strigi/streambase.h
 usr/include/strigi/streambuffer.h
 usr/include/strigi/stringstream.h
+usr/include/strigi/subinputstream.h
 usr/include/strigi/substreamprovider.h
 usr/include/strigi/substreamproviderprovider.h
 usr/include/strigi/jstreamsconfig.h

Deleted: kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r698697.diff

Added: kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r726017.diff
===================================================================
--- kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r726017.diff	                        (rev 0)
+++ kde-extras/strigi/trunk/debian/patches/01_strigi_branch_r726017.diff	2007-10-20 15:40:40 UTC (rev 7603)
@@ -0,0 +1,2406 @@
+--- a/cmake/FindCppUnit.cmake
++++ b/cmake/FindCppUnit.cmake
+@@ -7,7 +7,9 @@
+ 
+ include (MacroEnsureVersion)
+ 
+-SET(CPPUNIT_MIN_VERSION 1.12.0)
++if(NOT CPPUNIT_MIN_VERSION)
++  SET(CPPUNIT_MIN_VERSION 1.12.0)
++endif(NOT CPPUNIT_MIN_VERSION)
+ 
+ FIND_PROGRAM(CPPUNIT_CONFIG_EXECUTABLE cppunit-config )
+ 
+--- a/cmake/FindHyperEstraier.cmake
++++ b/cmake/FindHyperEstraier.cmake
+@@ -8,7 +8,7 @@
+ #
+ 
+ # find estconfig executable
+-FIND_PROGRAM(ESTCONFIG NAMES estconfig PATHS /bin /usr/bin /usr/local/bin )
++FIND_PROGRAM(ESTCONFIG NAMES estconfig PATHS /bin )
+ 
+ # get configuration options
+ IF (ESTCONFIG)
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -2,7 +2,6 @@
+ # Check copied from kdelibs FindX11.cmake.
+ CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+ 
+-
+ set(DIRS streams streamanalyzer archivereader xsd dummyindexer xmlindexer combinedindexer indexertests strigicmd)
+ 
+ if (CLucene_FOUND)
+@@ -11,32 +10,31 @@
+ 
+ if (HyperEstraier_FOUND)
+   set(DIRS ${DIRS} estraierindexer)
+-  message("** HyperEstraier support is experimental. **")
++  message("** HyperEstraier support is broken. Do not rely on it. **")
+ endif (HyperEstraier_FOUND)
+ 
+ if (SQLite_FOUND)
+   set(DIRS ${DIRS} sqliteindexer)
+-  message("** SQLite support is experimental. **")
++  message("** SQLite support is broken. Do not rely on it. **")
+ endif (SQLite_FOUND)
+ 
+-if (CLucene_FOUND OR HyperEstraier_FOUND OR SQLite_FOUND)
+-  if(NOT WIN32)
+-     set(DIRS ${DIRS} htmlgui)
+-  endif(NOT WIN32)
+-  # searchclient needs htmlgui which is not compilable on win32
+-  if (QT_QTDBUS_FOUND AND NOT WIN32)
+-     set(DIRS ${DIRS} searchclient)
+-  endif (QT_QTDBUS_FOUND AND NOT WIN32)
+-  # make sure we build the daemon on all architectures - not as long as sys/socket.h is used
+-  if(NOT WIN32)
+-    set(DIRS ${DIRS} daemon)
+-  endif(NOT WIN32)
+-  message(STATUS "Index libraries were found. strigidaemon will be built.")
+-else (CLucene_FOUND OR HyperEstraier_FOUND OR SQLite_FOUND)
+-  message("** No index libraries were found. strigidaemon will not be built.")
++if(NOT WIN32)
++  set(DIRS ${DIRS} htmlgui)
++endif(NOT WIN32)
++# searchclient needs htmlgui which is not compilable on win32
++if (QT_QTDBUS_FOUND AND NOT WIN32)
++  set(DIRS ${DIRS} searchclient)
++endif (QT_QTDBUS_FOUND AND NOT WIN32)
++# make sure we build the daemon on all architectures - not as long as sys/socket.h is used
++if(NOT WIN32)
++  set(DIRS ${DIRS} daemon)
++endif(NOT WIN32)
++
++if (NOT CLucene_FOUND)
++  message("** No CLucene libraries were found, so Strigi cannot use indexes.")
+   message("** It is recommended to install CLucene >= 0.9.16.")
+   message("** You will still be able to use deepfind, deepgrep and xmlindexer.")
+-endif (CLucene_FOUND OR HyperEstraier_FOUND OR SQLite_FOUND)
++endif (NOT CLucene_FOUND)
+ 
+ if (QT4_FOUND)
+   set(DIRS ${DIRS} archiveengine qclient)
+--- a/src/combinedindexer/CMakeLists.txt
++++ b/src/combinedindexer/CMakeLists.txt
+@@ -4,29 +4,7 @@
+ 	${strigi_BINARY_DIR}/src/streams
+ 	${strigi_SOURCE_DIR}/src/streams/strigi)
+ 
+-if (CLucene_FOUND)
+-    add_definitions(-DHAVE_CLUCENE)
+-    set(combinedindex_LIBS ${combinedindex_LIBS} cluceneindex)
+-    include_directories( ../luceneindexer )
+-endif (CLucene_FOUND)
+-
+-if (HyperEstraier_FOUND)
+-    add_definitions(-DHAVE_ESTRAIER)
+-    set(combinedindex_LIBS ${combinedindex_LIBS} estraierindex)
+-    include_directories( ../estraierindexer )
+-endif (HyperEstraier_FOUND)
+-
+-if (SQLite_FOUND)
+-    add_definitions(-DHAVE_SQLITE)
+-    set(combinedindex_LIBS ${combinedindex_LIBS} sqliteindex)
+-    include_directories( ../sqliteindexer )
+-endif (SQLite_FOUND)
+-
+ add_library(combinedindex combinedindexmanager.cpp)
+ 
+ target_link_libraries(combinedindex streamanalyzer grepindex
+     ${combinedindex_LIBS})
+-
+-#add_executable(combinedindexer combinedindexer.cpp)
+-#target_link_libraries(combinedindexer combinedindex filters)
+-
+--- a/src/combinedindexer/combinedindexmanager.cpp
++++ b/src/combinedindexer/combinedindexmanager.cpp
+@@ -21,6 +21,7 @@
+ #include <strigi/strigiconfig.h>
+ #include "variant.h"
+ 
++/*
+ #include "grepindexmanager.h"
+ #ifdef HAVE_CLUCENE
+ #include "cluceneindexmanager.h"
+@@ -34,20 +35,26 @@
+ #ifdef HAVE_SQLITE
+ #include "sqliteindexmanager.h"
+ #endif
++*/
+ 
+ #include "tssptr.h"
+ #include "query.h"
+ #include "indexeddocument.h"
+ #include "indexreader.h"
++#include "indexpluginloader.h"
+ #include <string>
+ #include <set>
+ #include <map>
+ using namespace std;
+ using namespace Strigi;
+ 
++/*
+ map<string, IndexManager*(*)(const char*)>
+ CombinedIndexManager::factories() {
+     map<string, IndexManager*(*)(const char*)> factories;
++    //IndexPluginLoader pluginloader;
++    //factories = pluginloader.factories();
++
+ #ifdef HAVE_ESTRAIER
+     factories["estraier"] = createEstraierIndexManager;
+ #endif
+@@ -74,7 +81,7 @@
+     }
+     return v;
+ }
+-
++*/
+ class CombinedIndexReader : public IndexReader {
+ private:
+     CombinedIndexManager* m;
+@@ -119,19 +126,21 @@
+ }
+ CombinedIndexManager::Private::~Private() {
+     if (writermanager) {
+-        delete writermanager;
++        IndexPluginLoader::deleteIndexManager(writermanager);
+     }
+ }
+ CombinedIndexManager::CombinedIndexManager(const string& type,
+         const string& indexdir) :p(new CombinedIndexManager::Private(this)) {
++    p->writermanager = IndexPluginLoader::createIndexManager(type.c_str(),
++        indexdir.c_str());
+     // determine the right index manager
+-    map<string, IndexManager*(*)(const char*)> l_factories = factories();
++/*    map<string, IndexManager*(*)(const char*)> l_factories = factories();
+     map<string, IndexManager*(*)(const char*)>::const_iterator f
+         = l_factories.find(type);
+     if (f == l_factories.end()) {
+         f = l_factories.begin();
+     }
+-    p->writermanager = f->second(indexdir.c_str());
++    p->writermanager = f->second(indexdir.c_str());*/
+ }
+ CombinedIndexManager::~CombinedIndexManager() {
+     delete p;
+@@ -148,14 +157,12 @@
+ CombinedIndexManager::addReadonlyIndex(const string& indexdir,
+         const string& type) {
+     removeReadonlyIndex(indexdir);
+-    // determine the right index manager
+-    map<string, IndexManager*(*)(const char*)> l_factories = factories();
+-    map<string, IndexManager*(*)(const char*)>::const_iterator f
+-        = l_factories.find(type);
+-    if (f == l_factories.end()) {
++
++    IndexManager* im = IndexPluginLoader::createIndexManager(type.c_str(),
++        indexdir.c_str());
++    if (im == 0) {
+         return;
+     }
+-    IndexManager* im = f->second(indexdir.c_str());
+     p->lock.lock();
+     p->readmanagers[indexdir] = im;
+     p->lock.unlock();
+--- a/src/combinedindexer/combinedindexmanager.h
++++ b/src/combinedindexer/combinedindexmanager.h
+@@ -40,10 +40,6 @@
+ 
+     void addReadonlyIndex(const std::string& indexdir, const std::string& type);
+     void removeReadonlyIndex(const std::string& indexdir);
+-
+-    static std::map<std::string, Strigi::IndexManager*(*)(const char*)>
+-        factories();
+-    static std::vector<std::string> backEnds();
+ };
+ 
+ #endif
+--- a/src/combinedindexer/tssptr.h
++++ b/src/combinedindexer/tssptr.h
+@@ -19,6 +19,7 @@
+  */
+ 
+ #include "strigi_thread.h"
++#include "indexpluginloader.h"
+ 
+ // thread safe smart pointer
+ template <class T>
+@@ -61,7 +62,7 @@
+             int c = --(p->count);
+             p->lock.unlock();
+             if (c == 0) {
+-                delete p->p;
++                Strigi::IndexPluginLoader::deleteIndexManager(p->p);
+                 delete p;
+             }
+             p = 0;
+--- a/src/daemon/daemon.cpp
++++ b/src/daemon/daemon.cpp
+@@ -21,6 +21,7 @@
+ #include "interface.h"
+ #include "daemonconfigurator.h"
+ #include "combinedindexmanager.h"
++#include "indexpluginloader.h"
+ 
+ #include "indexscheduler.h"
+ #include "analyzerconfiguration.h"
+@@ -151,7 +152,7 @@
+ }
+ void
+ printBackendList() {
+-    std::vector<std::string> backends = CombinedIndexManager::backEnds();
++    std::vector<std::string> backends = IndexPluginLoader::indexNames();
+     for ( unsigned int i = 0; i < backends.size(); ++i ) {
+         printf( "%s\n", backends[i].c_str() );
+     }
+@@ -194,7 +195,7 @@
+ }
+ void
+ ensureBackend( const std::string& backendName ) {
+-    std::vector<std::string> backends = CombinedIndexManager::backEnds();
++    std::vector<std::string> backends = IndexPluginLoader::indexNames();
+     if ( std::find( backends.begin(), backends.end(), backendName ) == backends.end() ) {
+         fprintf( stderr, "Unknown backend type: %s\n", backendName.c_str() );
+         exit( 2 );
+--- a/src/daemon/eventlistener/inotifylistener.cpp
++++ b/src/daemon/eventlistener/inotifylistener.cpp
+@@ -39,6 +39,38 @@
+ using namespace std;
+ using namespace Strigi;
+ 
++namespace {
++    /*!
++    * @param path string containing path to check
++    * Appends the terminating char to path.
++    * Under Windows that char is '\', '/' under *nix
++    */
++    string fixPath (string path)
++    {
++        if ( path.c_str() == NULL || path.length() == 0 )
++            return "";
++
++        string temp(path);
++
++    #ifdef HAVE_WINDOWS_H
++        size_t l= temp.length();
++        char* t = (char*)temp.c_str();
++        for (size_t i=0;i<l;i++){
++            if ( t[i] == '\\' )
++                t[i] = '/';
++        }
++        temp[0] = tolower(temp.at(0));
++    #endif
++
++        char separator = '/';
++
++        if (temp[temp.length() - 1 ] != separator)
++            temp += separator;
++
++        return temp;
++    }
++}
++
+ class MatchString {
+     string m_fixed_val;
+ 
+@@ -345,59 +377,38 @@
+     m_toWatch.clear();
+     m_toIndex.clear();
+     
+-    Strigi::FileLister lister (m_pindexerconfiguration);
+-    
+     for (set<string>::iterator iter = m_newDirs.begin();
+          iter != m_newDirs.end(); iter++)
+     {
+-        string filename;
+-        time_t mTime;
+-        
+-        lister.startListing( *iter);
+-        
+-        while (lister.nextFile( filename, mTime) != -1)
+-            m_toIndex.insert (make_pair (filename, mTime));
+-
+-        //TODO: look for a better solution
+-        set<string> temp = lister.getListedDirs();
+-        for (set<string>::iterator it = temp.begin(); it != temp.end(); it++)
+-            m_toWatch.insert(*it);
+-    }
+-    
+-    map <string, time_t> indexedFiles = m_pManager->indexReader()->files(0);
+-    map<string,time_t>::iterator mi = indexedFiles.begin();
+-
+-    while (mi != indexedFiles.end()) {
+-        map<string,time_t>::iterator it = m_toIndex.find(mi->first);
+-
+-        if (it == m_toIndex.end()) {
+-            // file has been deleted since last run
+-            m_events.push_back (new Event (Event::DELETED, mi->first));
++        DirLister lister(m_pindexerconfiguration);
++        string path;
++        vector<pair<string, struct stat> > dirs;
++
++        lister.startListing (*iter);
++        int ret = lister.nextDir(path, dirs);
++
++        while (ret != -1) {
++            for (vector<pair<string, struct stat> >::iterator iter = dirs.begin();
++                 iter != dirs.end(); iter++)
++            {
++                struct stat stats = iter->second;
+ 
+-            // no more useful, speedup into dirsRemoved
+-            map<string,time_t>::iterator itrm = mi;
+-            mi++;
+-            indexedFiles.erase(itrm);
+-        }
+-        else if (mi->second < it->second) {
+-            // file has been updated since last run
+-            m_events.push_back (new Event (Event::UPDATED, mi->first));
+-            m_toIndex.erase (it);
+-            mi++;
+-        }
+-        else {
+-            // file has NOT been changed since last run,
+-            // we keep our indexed information
+-            m_toIndex.erase (it);
+-            mi++;
++                if (S_ISDIR(stats.st_mode)) {
++                    //dir
++                    m_toWatch.insert (iter->first);
++                }
++                else if (S_ISREG(stats.st_mode)) {
++                    //file
++                    m_events.push_back (new Event (Event::CREATED, iter->first));
++                }
++            }
++            ret = lister.nextDir(path, dirs);
+         }
+     }
+ 
+-    // now m_toIndex contains only files created since the last run
+-    for (mi = m_toIndex.begin(); mi != m_toIndex.end(); mi++)
+-        m_events.push_back (new Event (Event::CREATED, mi->first));
+-
+     m_nomoreIndexedDirs.clear();
++    set<string> alreadyWatched;
++    
+     for (map<int, string>::iterator it = watchedDirs.begin();
+          it != watchedDirs.end(); it++)
+     {
+@@ -405,7 +416,68 @@
+         if (match == m_toWatch.end()) // dir is no longer watched
+             m_nomoreIndexedDirs.insert(it->second);
+         else // dir is already watched
+-            m_toWatch.erase (match);
++            alreadyWatched.insert (*match);
++    }
++
++    // look for updated dirs
++    m_toIndex.clear();
++    for (set<string>::iterator iter = alreadyWatched.begin();
++         iter != alreadyWatched.end(); iter++)
++    {
++        // retrieve files contained into the already watched dirs
++
++        Strigi::DirLister lister (m_pindexerconfiguration);
++
++        lister.startListing (*iter);
++
++        string path;
++        vector<pair<string, struct stat> > dirs;
++        int ret = lister.nextDir(path, dirs);
++
++        while (ret != -1) {
++            cout << "path = " << path << endl;
++
++            for (vector<pair<string, struct stat> >::iterator iter = dirs.begin();
++                 iter != dirs.end(); iter++)
++            {
++                struct stat stats = iter->second;
++                if (S_ISREG(stats.st_mode))
++                    m_toIndex.insert (make_pair (iter->first, stats.st_mtime));
++            }
++            ret = lister.nextDir(path, dirs);
++        }
++
++        map <string, time_t> indexedFiles;
++        m_pManager->indexReader()->getChildren (*iter, indexedFiles);
++        for (map<string, time_t>::iterator iter = m_toIndex.begin();
++             iter != m_toIndex.end(); iter++)
++        {
++            map<string, time_t>::iterator match;
++            match = indexedFiles.find(iter->first);
++            if (match == indexedFiles.end()) {
++                // new file created
++                m_events.push_back (new Event (Event::CREATED, iter->first));
++            }
++            else if (match->second < iter->second) {
++                // file has been updated
++                m_events.push_back (new Event (Event::UPDATED, iter->first));
++            }
++        }
++        m_toIndex.clear();
++    }
++
++    // remove no more indexed items
++    for (set<string>::iterator iter = m_nomoreIndexedDirs.begin();
++         iter != m_nomoreIndexedDirs.end(); iter++)
++    {
++        map <string, time_t> indexedFiles;
++        m_pManager->indexReader()->getChildren (*iter, indexedFiles);
++
++        for (map<string,time_t>::iterator mi = indexedFiles.begin();
++             mi != indexedFiles.end(); mi++)
++        {
++            m_events.push_back (new Event (Event::DELETED, mi->first));
++        }
+     }
+     
+     if (testInterrupt()) {
+@@ -738,25 +810,35 @@
+                     // a new directory has been created or an already watched
+                     // directory has been moved into a watched place
+                     
+-                    m_toIndex.clear();
+                     m_toWatch.clear();
+ 
+-                    FileLister lister(m_pindexerconfiguration);
+-                    
+-                    string filename;
+-                    time_t mTime;
+-                    while (lister.nextFile( filename, mTime) != -1)
+-                        m_toIndex.insert (make_pair (filename, mTime));
+-
+-                    m_toWatch = lister.getListedDirs();
+-
+-                    for (map<string,time_t>::iterator i = m_toIndex.begin();
+-                         i != m_toIndex.end(); i++)
+-                    {
+-                        Event* event = new Event (Event::CREATED, i->first);
+-                        events.push_back (event);
++                    DirLister lister(m_pindexerconfiguration);
++                    string path;
++                    vector<pair<string, struct stat> > dirs;
++
++                    lister.startListing (file);
++                    int ret = lister.nextDir(path, dirs);
++
++                    while (ret != -1) {
++                        for (vector<pair<string, struct stat> >::iterator iter = dirs.begin();
++                             iter != dirs.end(); iter++)
++                        {
++                            struct stat stats = iter->second;
++                            
++                            if (S_ISDIR(stats.st_mode)) {
++                                //dir
++                                m_toWatch.insert (iter->first);
++                            }
++                            else if (S_ISREG(stats.st_mode)) {
++                                //file
++                                Event* event = new Event (Event::CREATED,
++                                                          iter->first);
++                                events.push_back (event);
++                            }
++                        }
++                        ret = lister.nextDir(path, dirs);
+                     }
+-
++                    
+                     // add new watches
+                     addWatches (m_toWatch);
+ 
+@@ -1066,8 +1148,9 @@
+     // we've to de-index all files contained into the deleted/moved directory
+     if (m_pManager)
+     {
+-        // all indexed files
+-        map<string, time_t> indexedFiles = m_pManager->indexReader()->files(0);
++        // all indexed files contained into dir
++        map<string, time_t> indexedFiles;
++        m_pManager->indexReader()->getChildren(dir, indexedFiles);
+ 
+         // remove all entries that were contained into the removed dir
+         for (map<string, time_t>::iterator it = indexedFiles.begin();
+@@ -1076,12 +1159,8 @@
+             if (enableInterrupt && testInterrupt())
+                 break;
+             
+-            string::size_type pos = (it->first).find (dir);
+-            if (pos == 0)
+-            {
+-                Event* event = new Event (Event::DELETED, it->first);
+-                newEvents.push_back (event);
+-            }
++            Event* event = new Event (Event::DELETED, it->first);
++            newEvents.push_back (event);
+         }
+     }
+     else
+--- a/src/daemon/eventlistener/pollinglistener.cpp
++++ b/src/daemon/eventlistener/pollinglistener.cpp
+@@ -38,6 +38,38 @@
+ using namespace std;
+ using namespace Strigi;
+ 
++namespace {
++    /*!
++    * @param path string containing path to check
++    * Appends the terminating char to path.
++    * Under Windows that char is '\', '/' under *nix
++    */
++    string fixPath (string path)
++    {
++        if ( path.c_str() == NULL || path.length() == 0 )
++            return "";
++
++        string temp(path);
++
++    #ifdef HAVE_WINDOWS_H
++        size_t l= temp.length();
++        char* t = (char*)temp.c_str();
++        for (size_t i=0;i<l;i++){
++            if ( t[i] == '\\' )
++                t[i] = '/';
++        }
++        temp[0] = tolower(temp.at(0));
++    #endif
++
++        char separator = '/';
++
++        if (temp[temp.length() - 1 ] != separator)
++            temp += separator;
++
++        return temp;
++    }
++}
++
+ PollingListener::PollingListener() :EventListener("PollingListener") {
+     setState(Idling);
+     STRIGI_MUTEX_INIT(&m_mutex);
+@@ -123,35 +155,7 @@
+ 
+     STRIGI_MUTEX_UNLOCK (&m_mutex);
+ }
+-/*!
+-* @param path string containing path to check
+-* Appends the terminating char to path.
+-* Under Windows that char is '\', '/' under *nix
+-*/
+-string fixPath (string path)
+-{
+-    if ( path.c_str() == NULL || path.length() == 0 )
+-        return "";
+-
+-    string temp(path);
+-
+-#ifdef HAVE_WINDOWS_H
+-    size_t l= temp.length();
+-    char* t = (char*)temp.c_str();
+-    for (size_t i=0;i<l;i++){
+-        if ( t[i] == '\\' )
+-            t[i] = '/';
+-    }
+-    temp[0] = tolower(temp.at(0));
+-#endif
+-
+-    char separator = '/';
+ 
+-    if (temp[temp.length() - 1 ] != separator)
+-        temp += separator;
+-
+-    return temp;
+-}
+ void
+ PollingListener::addWatches(const set<string>& watches, bool enableInterrupt) {
+     for (set<string>::iterator iter = watches.begin();
+--- a/src/daemon/interface.cpp
++++ b/src/daemon/interface.cpp
+@@ -18,9 +18,10 @@
+  * Boston, MA 02110-1301, USA.
+  */
+ #include "interface.h"
+-#include "indexreader.h"
+ #include "combinedindexmanager.h"
++#include "indexreader.h"
+ #include "indexwriter.h"
++#include "indexpluginloader.h"
+ #include "indexscheduler.h"
+ #include "eventlistener.h"
+ #include "streamanalyzer.h"
+@@ -69,7 +70,7 @@
+ }
+ vector<string>
+ Interface::getBackEnds() {
+-    return manager.backEnds();
++    return IndexPluginLoader::indexNames();
+ }
+ map<string, string>
+ Interface::getStatus() {
+--- a/src/estraierindexer/CMakeLists.txt
++++ b/src/estraierindexer/CMakeLists.txt
+@@ -3,15 +3,26 @@
+ include_directories( ../streamanalyzer ../streams ${EST_INCLUDE_DIR}
+ 	${strigi_BINARY_DIR}/src/streams
+ 	${strigi_SOURCE_DIR}/src/streams/strigi)
++link_directories(${EST_LIBDIR})
++set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EST_CFLAGS}")
+ 
+-add_library(estraierindex
++if(WIN32)
++  # this is needed to have mingw, cygwin and msvc libs installed in one directory
++  if(MSVC)
++    set(prefix msvc_strigiindex_)
++  elseif(CYGWIN)
++    set(prefix cyg_strigiindex_)
++  elseif(MINGW)
++    set(prefix mingw_strigiindex_)
++  endif(MSVC)
++else(WIN32)
++  set(prefix strigiindex_)
++endif(WIN32)
++add_library(estraier MODULE
+ 	estraierindexmanager.cpp
+         estraierindexreader.cpp
+ 	estraierindexwriter.cpp
+ )
+-
+-target_link_libraries(estraierindex streamanalyzer ${EST_LIBS})
+-
+-add_executable(estraierindexer estraierindexer.cpp)
+-target_link_libraries(estraierindexer estraierindex)
+-
++set_target_properties(estraier PROPERTIES PREFIX ${prefix})
++target_link_libraries(estraier streamanalyzer ${EST_LIBS})
++install(TARGETS estraier LIBRARY DESTINATION ${LIB_DESTINATION}/strigi)
+--- a/src/estraierindexer/estraierindexmanager.cpp
++++ b/src/estraierindexer/estraierindexmanager.cpp
+@@ -22,14 +22,19 @@
+ #include "estraierindexreader.h"
+ #include "estraierindexwriter.h"
+ #include "strigi_thread.h"
++#include "indexplugin.h"
+ #include <assert.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
++#include <errno.h>
+ #include "stgdirent.h" //our dirent compatibility header... uses native if available
+ using namespace std;
+ using namespace Strigi;
+ 
++/* define and export the index factory */
++REGISTER_STRIGI_INDEXMANAGER(EstraierIndexManager)
++
+ pthread_mutex_t EstraierIndexManager::lock = PTHREAD_MUTEX_INITIALIZER;
+ 
+ Strigi::IndexManager*
+--- a/src/estraierindexer/estraierindexreader.cpp
++++ b/src/estraierindexer/estraierindexreader.cpp
+@@ -37,7 +37,7 @@
+     // build the phrase string
+ 
+     // write the part of the query that matches the document context
+-    string inphrase, exphrase;
++/*    string inphrase, exphrase;
+     set<string> terms;
+     const map<string, set<string> >& includes = query.includes();
+     map<string, set<string> >::const_iterator i = includes.find("");
+@@ -60,9 +60,9 @@
+             phrase += " ANDNOT ";
+         }
+         phrase += *j;
+-    }
++    } */
+     ESTCOND* cond = est_cond_new();
+-    printf("%s", phrase.c_str());
++/*    printf("%s", phrase.c_str());
+     if (phrase.length() > 0) {
+         est_cond_set_phrase(cond, phrase.c_str());
+     }
+@@ -93,7 +93,7 @@
+             est_cond_add_attr(cond, att.c_str());
+         }
+     }
+-    printf("\n");
++    printf("\n");*/ 
+ 
+     return cond;
+ }
+@@ -136,7 +136,7 @@
+     return n;
+ }
+ vector<IndexedDocument>
+-EstraierIndexReader::query(const Query& query) {
++EstraierIndexReader::query(const Query& query, int off, int max) {
+     ESTCOND* cond = createCondition(query);
+     est_cond_set_max(cond, 10);
+     int n;
+@@ -182,9 +182,17 @@
+     free(ids);
+     return results;
+ }
+-map<string, time_t>
+-EstraierIndexReader::files(char depth) {
+-    map<string, time_t> files;
++void
++EstraierIndexReader::getHits(const Strigi::Query& query,
++        const std::vector<std::string>& fields,
++        const std::vector<Strigi::Variant::Type>& types,
++        std::vector<std::vector<Strigi::Variant> >& result,
++        int off, int max) {
++}
++void
++EstraierIndexReader::getChildren(const std::string& parent,
++            std::map<std::string, time_t>& children) {
++/*    map<string, time_t> files;
+     ESTCOND* cond = est_cond_new();
+     string q = "depth NUMEQ 0";
+     est_cond_add_attr(cond, q.c_str());
+@@ -208,7 +216,7 @@
+     // clean up
+     est_cond_delete(cond);
+     free(ids);
+-    return files;
++    return files;*/
+ }
+ int32_t
+ EstraierIndexReader::countDocuments() {
+@@ -231,16 +239,10 @@
+     manager->deref();
+     return count;
+ }
+-int64_t
+-EstraierIndexReader::documentId(const string& uri) {
+-    ESTDB* db = manager->ref();
+-    int64_t id = est_db_uri_to_id(db, uri.c_str());
+-    manager->deref();
+-    return id;
+-}
+ time_t
+-EstraierIndexReader::mTime(int64_t docid) {
++EstraierIndexReader::mTime(const std::string& uri) {
+     ESTDB* db = manager->ref();
++    int64_t docid = est_db_uri_to_id(db, uri.c_str());
+     time_t mtime = -1;
+     char *cstr = est_db_get_doc_attr(db, docid, "@mdate");
+     if (cstr) {
+@@ -248,12 +250,7 @@
+         free(cstr);
+     }
+     manager->deref();
+-    return mtime;
+-
+-}
+-time_t
+-EstraierIndexReader::mTime(const std::string& uri) {
+-    return mTime(documentId(uri));
++    return docid;
+ }
+ vector<string>
+ EstraierIndexReader::fieldNames() {
+@@ -264,3 +261,14 @@
+             const string& labeltype) {
+     return vector<pair<string,uint32_t> >();
+ }
++int32_t
++EstraierIndexReader::countKeywords(const std::string& keywordprefix,
++        const std::vector<std::string>& fieldnames) {
++    return -1;
++}
++vector<string>
++EstraierIndexReader::keywords(const std::string& keywordmatch,
++        const std::vector<std::string>& fieldnames,
++        uint32_t max, uint32_t offset) {
++    return vector<string>();
++}
+--- a/src/estraierindexer/estraierindexreader.h
++++ b/src/estraierindexer/estraierindexreader.h
+@@ -36,14 +36,14 @@
+     static ESTCOND* createCondition(const Strigi::Query&);
+     static const char* mapId(const std::string& id);
+ public:
++    std::vector<Strigi::IndexedDocument> query(const Strigi::Query&,
++        int off, int max);
++    void getHits(const Strigi::Query& query,
++        const std::vector<std::string>& fields,
++        const std::vector<Strigi::Variant::Type>& types,
++        std::vector<std::vector<Strigi::Variant> >& result,
++        int off, int max);
+     int32_t countHits(const Strigi::Query&);
+-    std::vector<Strigi::IndexedDocument> query(const Strigi::Query&);
+-    std::map<std::string, time_t> files(char depth);
+-    int countDocuments();
+-    int32_t countWords();
+-    int64_t indexSize();
+-    int64_t documentId(const std::string& uri);
+-    time_t mTime(int64_t docid);
+     time_t mTime(const std::string& uri);
+     std::vector<std::string> fieldNames();
+     std::vector<std::pair<std::string,uint32_t> > histogram(
+@@ -54,6 +54,11 @@
+     std::vector<std::string> keywords(const std::string& keywordmatch,
+         const std::vector<std::string>& fieldnames,
+         uint32_t max, uint32_t offset);
++    void getChildren(const std::string& parent,
++            std::map<std::string, time_t>& children);
++    int countDocuments();
++    int32_t countWords();
++    int64_t indexSize();
+ };
+ 
+ #endif
+--- a/src/estraierindexer/estraierindexwriter.cpp
++++ b/src/estraierindexer/estraierindexwriter.cpp
+@@ -49,16 +49,16 @@
+ EstraierIndexWriter::addValue(const AnalysisResult* idx,
+         const RegisteredField* field, const string& value) {
+     ESTDOC* doc = static_cast<ESTDOC*>(idx->writerData());
+-    if (field->getKey() == "size") {
++    if (field->key() == "size") {
+         est_doc_add_attr(doc, "@size", value.c_str());
+-    } else if (field->getKey() == "title") {
++    } else if (field->key() == "title") {
+         est_doc_add_attr(doc, "@title", value.c_str());
+     } else {
+-        est_doc_add_attr(doc, field->getKey().c_str(), value.c_str());
++        est_doc_add_attr(doc, field->key().c_str(), value.c_str());
+     }
+ }
+ void
+-EstraierIndexWriter::startAnalysis(AnalysisResult* idx) {
++EstraierIndexWriter::startAnalysis(const AnalysisResult* idx) {
+     // allocate a new estraier document
+     ESTDOC* doc = est_doc_new();
+     idx->setWriterData(doc);
+--- a/src/estraierindexer/estraierindexwriter.h
++++ b/src/estraierindexer/estraierindexwriter.h
+@@ -31,7 +31,7 @@
+     const std::string indexpath;
+ 
+ protected:
+-    void startAnalysis(Strigi::AnalysisResult*);
++    void startAnalysis(const Strigi::AnalysisResult*);
+     void addValue(const Strigi::AnalysisResult*, const Strigi::RegisteredField* field,
+         const std::string& value);
+     void addValue(const Strigi::AnalysisResult*, const Strigi::RegisteredField* field,
+--- a/src/estraierindexer/tests/CMakeLists.txt
++++ b/src/estraierindexer/tests/CMakeLists.txt
+@@ -1,9 +1,10 @@
+ include_directories(.. ../../indexertests)
++link_directories(${EST_LIBDIR})
+ 
+ CREATE_TEST_SOURCELIST(Tests testrunner.cpp EstraierTest.cpp)
+ 
+ ADD_EXECUTABLE(testrunner ${Tests} )
+-target_link_libraries(testrunner streams estraierindex indexertests)
++target_link_libraries(testrunner streams indexertests)
+ 
+ SET (TestsToRun ${Tests})
+ REMOVE (TestsToRun testrunner.cpp)
+--- a/src/estraierindexer/tests/EstraierTest.cpp
++++ b/src/estraierindexer/tests/EstraierTest.cpp
+@@ -1,5 +1,6 @@
+ #include <strigi/strigiconfig.h>
+-#include "estraierindexmanager.h"
++#include "indexpluginloader.h"
++#include "indexmanager.h"
+ #include "indexmanagertests.h"
+ #include "indexwritertests.h"
+ #include "indexreadertests.h"
+@@ -15,7 +16,8 @@
+ 
+     // initialize a directory for writing and an indexmanager
+     mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR);
+-    EstraierIndexManager* manager = new EstraierIndexManager(path);
++    Strigi::IndexManager *manager
++            = Strigi::IndexPluginLoader::createIndexManager("estraier", path);
+ 
+     Strigi::AnalyzerConfiguration ic;
+     IndexManagerTests tests(manager, ic);
+--- a/src/htmlgui/strigihtmlgui.cpp
++++ b/src/htmlgui/strigihtmlgui.cpp
+@@ -27,6 +27,7 @@
+ #include <dirent.h>
+ #include <sstream>
+ #include <fstream>
++#include <iostream>
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -56,7 +57,9 @@
+ }
+ void
+ StrigiHtmlGui::printHtmlHeader(ostream& out) {
+-    out << "<?xml version='1.0' encoding='utf-8'?>\n"
++    // FIXME: extra spaces added at the beginning as a wordaround because
++    // KIO discards several first chars for unknown reason
++    out << "                           <?xml version='1.0' encoding='utf-8'?>\n"
+         "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' "
+         "'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>\n"
+         "<html xmlns='http://www.w3.org/1999/xhtml'>"
+@@ -190,12 +193,15 @@
+     if (i != params.end()) {
+         max = atoi(i->second.c_str());
+     }
+-    if (max == 0) max = 10;
++    if (max <= 0 || max > 1000) max = 10;
+     int off = 0;
+     i = params.find("o");
+     if (i != params.end()) {
+         off = atoi(i->second.c_str());
+     }
++    if (off < 0) {
++        off = 0;
++    }
+     string selectedtab;
+     i = params.find("t");
+     if (i != params.end()) {
+@@ -215,20 +221,23 @@
+         bool doother = true;
+         tabs = readTabQueries();
+         if (tabs.size() == 0) {
+-            tabs["Images"] = "content.mime_type:image*";
+-            tabs["Mail"] = "content.mime_type:message/*";
+-            tabs["Web"] = "content.mime_type:text/html";
+-            tabs["Text"] = "content.mime_type:text/*";
++            tabs["Images"] = "mimeType:image*";
++            tabs["Mail"] = "mimeType:message/*";
++            tabs["Web"] = "mimeType:text/html";
++            tabs["Text"] = "mimeType:text/*";
+         }
+         map<string, string>::const_iterator j;
+         string otherq = query;
+         for (j = tabs.begin(); j != tabs.end(); ++j) {
+-            string q = query+' '+j->second;
++            string q = query;
++            if (q != j->second) {
++                q += ' ' + j->second;
++            }
+             int c = p->strigi.countHits(q);
+             if (c > 0) {
+                 hitcounts[j->first] = c;
+                 doother &= c < count;
+-        otherq += " -" + j->second;
++                otherq += " -" + j->second;
+                 if (j->first == selectedtab || activetab.size() == 0) {
+                     activetab = j->first;
+                     activequery = q;
+@@ -424,9 +433,9 @@
+         icon = "<div class='iconbox'><img class='icon' src='"+icon;
+         icon += "'/></div>\n";
+     }
+-    t = doc.properties.find("audio.title");
++    t = doc.properties.find("title");
+     if (t == doc.properties.end()) {
+-        t = doc.properties.find("email.subject");
++        t = doc.properties.find("subject");
+     }
+     size_t l = doc.uri.rfind('/');
+     if (t != doc.properties.end()) {
+--- a/src/luceneindexer/cluceneindexmanager.cpp
++++ b/src/luceneindexer/cluceneindexmanager.cpp
+@@ -27,12 +27,17 @@
+ #include <CLucene.h>
+ #include "cluceneindexwriter.h"
+ #include "cluceneindexreader.h"
++#include "indexplugin.h"
+ #include <iostream>
+ #include <sys/types.h>
+ #include <time.h>
+ #include "timeofday.h"
+ #include "stgdirent.h" //our dirent compatibility header... uses native if available
+ 
++
++/* define and export the index factory */
++REGISTER_STRIGI_INDEXMANAGER(CLuceneIndexManager)
++
+ using namespace lucene::index;
+ using lucene::analysis::standard::StandardAnalyzer;
+ using lucene::store::FSDirectory;
+@@ -201,3 +206,4 @@
+     mtime = t.tv_sec;
+     lock.unlock();
+ }
++
+--- a/src/luceneindexer/cluceneindexmanager.h
++++ b/src/luceneindexer/cluceneindexmanager.h
+@@ -22,7 +22,6 @@
+ 
+ #include <strigi/strigiconfig.h>
+ #include "indexmanager.h"
+-//#include "querybitset.h"
+ #include <strigi_thread.h>
+ #include <string>
+ #include <map>
+@@ -50,7 +49,6 @@
+     std::map<STRIGI_THREAD_TYPE, CLuceneIndexReader*> readers;
+     CLuceneIndexWriter* writer;
+     lucene::index::IndexWriter* indexwriter;
+-    //Strigi::QueryBitsetCache bitsets;
+     lucene::analysis::Analyzer* analyzer;
+     time_t mtime;
+     static int numberOfManagers;
+@@ -65,7 +63,6 @@
+     Strigi::IndexReader* indexReader();
+     Strigi::IndexWriter* indexWriter();
+     CLuceneIndexReader* luceneReader();
+-//    Strigi::QueryBitsetCache* bitSets();
+     int32_t docCount();
+     int64_t indexSize();
+     void deleteIndex();
+@@ -74,7 +71,7 @@
+     void setIndexMTime();
+ };
+ 
+-CLUCENEINDEXER_EXPORT Strigi::IndexManager*
+-createCLuceneIndexManager(const char* path);
++//CLUCENEINDEXER_EXPORT Strigi::IndexManager*
++//createCLuceneIndexManager(const char* path);
+ 
+ #endif
+--- a/src/luceneindexer/cluceneindexwriter.cpp
++++ b/src/luceneindexer/cluceneindexwriter.cpp
+@@ -240,8 +240,11 @@
+             if (t && _tcsncmp(t, prefixText, prefixLen) == 0) {
+                 try {
+                     reader->deleteDocument(i);
++                } catch (CLuceneError& err) {
++                    cerr << "Could not delete document '" << entry
++                        << "' from the index: " << err.what() << endl;
+                 } catch (...) {
+-                    fprintf(stderr, "could not delete document");
++                    cerr << "This should not happen." << endl;
+                 }
+             }
+             _CLDELETE(d);
+--- a/src/luceneindexer/CMakeLists.txt
++++ b/src/luceneindexer/CMakeLists.txt
+@@ -19,42 +19,44 @@
+     ADD_DEFINITIONS(-DUNICODE)
+ ENDIF(WIN32)
+ 
+-# CLucene requires exception support and has no support for visibility=hidden
+-# so we must use the default (i.e. public) value for -fvisibility
++# CLucene requires exception support
+ IF(NOT WIN32)
+     IF (CMAKE_COMPILER_IS_GNUCXX)
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
+     ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ ENDIF(NOT WIN32)
+-IF(__STRIGI_HAVE_GCC_VISIBILITY)
+-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
+-ENDIF(__STRIGI_HAVE_GCC_VISIBILITY)
++# In the past, we though we needed to use -fvisibility=default for compiling
++# this library. This appears not to be the case anymore.
++#IF(__STRIGI_HAVE_GCC_VISIBILITY)
++#    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
++#ENDIF(__STRIGI_HAVE_GCC_VISIBILITY)
+ 
+ set(cluceneindex_SRCS
+-#        PrefixFilter.cpp
+-        cluceneindexmanager.cpp
+-        cluceneindexreader.cpp
+-        cluceneindexwriter.cpp
+-        jsgzipcompressstream.cpp
+-	tcharutils.cpp
++    cluceneindexmanager.cpp
++    cluceneindexreader.cpp
++    cluceneindexwriter.cpp
++    jsgzipcompressstream.cpp
++    tcharutils.cpp
+ )
+ 
+-add_library(cluceneindex SHARED ${cluceneindex_SRCS})
+-
+-set_target_properties(cluceneindex
+-    PROPERTIES VERSION ${STRIGI_VERSION}
+-    SOVERSION ${STRIGI_VERSION_MAJOR}
+-    DEFINE_SYMBOL MAKE_CLUCENEINDEXER_LIB
+-)
+-
+-target_link_libraries(cluceneindex streamanalyzer ${CLUCENE_LIBRARY})
++if(WIN32)
++  # this is needed to have mingw, cygwin and msvc libs installed in one directory
++  if(MSVC)
++    set(prefix msvc_strigiindex_)
++  elseif(CYGWIN)
++    set(prefix cyg_strigiindex_)
++  elseif(MINGW)
++    set(prefix mingw_strigiindex_)
++  endif(MSVC)
++else(WIN32)
++  set(prefix strigiindex_)
++endif(WIN32)
++add_library(clucene MODULE ${cluceneindex_SRCS})
++set_target_properties(clucene PROPERTIES PREFIX ${prefix})
++target_link_libraries(clucene streamanalyzer ${CLUCENE_LIBRARY})
++install(TARGETS clucene LIBRARY DESTINATION ${LIB_DESTINATION}/strigi)
+ 
+ add_executable(luceneindexer luceneindexer.cpp)
+-target_link_libraries(luceneindexer cluceneindex)
++target_link_libraries(luceneindexer streamanalyzer)
+ 
+ install(TARGETS luceneindexer RUNTIME DESTINATION bin)
+-install(TARGETS cluceneindex
+-	LIBRARY DESTINATION ${LIB_DESTINATION}
+-	RUNTIME DESTINATION bin
+-	ARCHIVE DESTINATION  ${LIB_DESTINATION}
+-)
+--- a/src/luceneindexer/indexdump/CMakeLists.txt
++++ b/src/luceneindexer/indexdump/CMakeLists.txt
+@@ -1,4 +1,4 @@
+ include_directories(${CLUCENE_LIBRARY_DIR} ${CLUCENE_INCLUDE_DIR}
+ 	${ICONV_INCLUDE_DIR} ..)
+-add_executable(indexdump indexdump.cpp)
+-target_link_libraries(indexdump ${CLUCENE_LIBRARY} cluceneindex)
++add_executable(indexdump indexdump.cpp ../tcharutils.cpp)
++target_link_libraries(indexdump streamanalyzer ${CLUCENE_LIBRARY})
+--- a/src/luceneindexer/luceneindexer.cpp
++++ b/src/luceneindexer/luceneindexer.cpp
+@@ -18,9 +18,8 @@
+  * Boston, MA 02110-1301, USA.
+  */
+ #include <strigi/strigiconfig.h>
+-#include <CLucene.h>
+ #include "diranalyzer.h"
+-#include "cluceneindexmanager.h"
++#include "indexpluginloader.h"
+ #include "analyzerconfiguration.h"
+ #include <iostream>
+ #include <sys/types.h>
+@@ -65,10 +64,13 @@
+     Strigi::AnalyzerConfiguration ic;
+     ic.setFilters(filters);
+     try {
+-        Strigi::IndexManager *manager = createCLuceneIndexManager(argv[1]);
+-        Strigi::DirAnalyzer analyzer(*manager, ic);
+-        analyzer.analyzeDir(argv[2]);
+-        delete manager;
++        Strigi::IndexManager *manager
++            = Strigi::IndexPluginLoader::createIndexManager("clucene", argv[1]);
++        if (manager) {
++            Strigi::DirAnalyzer analyzer(*manager, ic);
++            analyzer.analyzeDir(argv[2]);
++            Strigi::IndexPluginLoader::deleteIndexManager(manager);
++        }
+     } catch (...) {
+         cerr << "error while creating index" << endl;
+     }
+--- a/src/luceneindexer/tcharutils.h
++++ b/src/luceneindexer/tcharutils.h
+@@ -25,9 +25,9 @@
+ #include <string>
+ #include <strigi/strigiconfig.h>
+ 
+-std::string CLUCENEINDEXER_EXPORT wchartoutf8(const wchar_t*);
+-std::wstring CLUCENEINDEXER_EXPORT utf8toucs2(const char*);
+-std::string CLUCENEINDEXER_EXPORT wchartoutf8(const std::wstring&);
+-std::wstring CLUCENEINDEXER_EXPORT utf8toucs2(const std::string&);
++std::string wchartoutf8(const wchar_t*);
++std::wstring utf8toucs2(const char*);
++std::string wchartoutf8(const std::wstring&);
++std::wstring utf8toucs2(const std::string&);
+ 
+ #endif
+--- a/src/luceneindexer/tests/CLuceneTest.cpp
++++ b/src/luceneindexer/tests/CLuceneTest.cpp
+@@ -1,5 +1,6 @@
+ #include <strigi/strigiconfig.h>
+-#include "cluceneindexmanager.h"
++#include "indexpluginloader.h"
++#include "indexmanager.h"
+ #include "indexmanagertests.h"
+ #include "indexwritertests.h"
+ #include "indexreadertests.h"
+@@ -23,7 +24,12 @@
+ #else
+     mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR);
+ #endif
+-    Strigi::IndexManager* manager = createCLuceneIndexManager(path);
++    Strigi::IndexManager* manager
++        = Strigi::IndexPluginLoader::createIndexManager("clucene", path);
++    if (manager == 0) {
++        founderrors++;
++        return founderrors;
++    }
+ 
+     Strigi::AnalyzerConfiguration ic;
+     IndexManagerTests tests(manager, ic);
+@@ -39,7 +45,7 @@
+     rtests.testAll();
+ 
+     // close and clean up the manager
+-    delete manager;
++    Strigi::IndexPluginLoader::deleteIndexManager(manager);
+ 
+     // clean up data
+     std::string cmd = "rm -r ";
+--- a/src/luceneindexer/tests/CMakeLists.txt
++++ b/src/luceneindexer/tests/CMakeLists.txt
+@@ -3,7 +3,7 @@
+ CREATE_TEST_SOURCELIST(Tests testrunner.cpp CLuceneTest.cpp)
+ 
+ ADD_EXECUTABLE(testrunner-lucene ${Tests} )
+-target_link_libraries(testrunner-lucene streams cluceneindex indexertests)
++target_link_libraries(testrunner-lucene streamanalyzer indexertests)
+ 
+ SET (TestsToRun ${Tests})
+ REMOVE (TestsToRun testrunner.cpp)
+--- a/src/sqliteindexer/CMakeLists.txt
++++ b/src/sqliteindexer/CMakeLists.txt
+@@ -4,14 +4,23 @@
+ 	${SQLITE_LIBRARY_DIR} ${SQLITE_INCLUDE_DIR}
+ 	${strigi_BINARY_DIR}/src/streams)
+ 
+-add_library(sqliteindex
++if(WIN32)
++  # this is needed to have mingw, cygwin and msvc libs installed in one directory
++  if(MSVC)
++    set(prefix msvc_strigiindex_)
++  elseif(CYGWIN)
++    set(prefix cyg_strigiindex_)
++  elseif(MINGW)
++    set(prefix mingw_strigiindex_)
++  endif(MSVC)
++else(WIN32)
++  set(prefix strigiindex_)
++endif(WIN32)
++add_library(sqlite MODULE
+ 	sqliteindexmanager.cpp
+         sqliteindexreader.cpp
+ 	sqliteindexwriter.cpp
+ )
+-
+-target_link_libraries(sqliteindex streamanalyzer ${SQLITE_LIBRARIES})
+-
+-add_executable(sqliteindexer sqliteindexer.cpp)
+-target_link_libraries(sqliteindexer sqliteindex sqlite3)
+-
++set_target_properties(sqlite PROPERTIES PREFIX ${prefix})
++target_link_libraries(sqlite ${SQLITE_LIBRARIES})
++install(TARGETS sqlite LIBRARY DESTINATION ${LIB_DESTINATION}/strigi)
+--- a/src/sqliteindexer/sqliteindexmanager.cpp
++++ b/src/sqliteindexer/sqliteindexmanager.cpp
+@@ -21,9 +21,13 @@
+ #include "sqliteindexreader.h"
+ #include "sqliteindexwriter.h"
+ #include "strigi_thread.h"
++#include "indexplugin.h"
+ using namespace std;
+ using namespace Strigi;
+ 
++/* define and export the index factory */
++REGISTER_STRIGI_INDEXMANAGER(SqliteIndexManager)
++
+ pthread_mutex_t SqliteIndexManager::lock = PTHREAD_MUTEX_INITIALIZER;
+ 
+ Strigi::IndexManager*
+--- a/src/sqliteindexer/sqliteindexreader.cpp
++++ b/src/sqliteindexer/sqliteindexreader.cpp
+@@ -245,3 +245,10 @@
+     vector<string> k;
+     return k;
+ }
++void
++SqliteIndexReader::getHits(const Strigi::Query& query,
++        const std::vector<std::string>& fields,
++        const std::vector<Strigi::Variant::Type>& types,
++        std::vector<std::vector<Strigi::Variant> >& result,
++        int off, int max) {
++}
+--- a/src/sqliteindexer/sqliteindexreader.h
++++ b/src/sqliteindexer/sqliteindexreader.h
+@@ -48,6 +48,11 @@
+     std::vector<std::string> keywords(const std::string& keywordmatch,
+         const std::vector<std::string>& fieldnames,
+         uint32_t max, uint32_t offset);
++    void getHits(const Strigi::Query& query,
++        const std::vector<std::string>& fields,
++        const std::vector<Strigi::Variant::Type>& types,
++        std::vector<std::vector<Strigi::Variant> >& result,
++        int off, int max);
+ };
+ 
+ #endif
+--- a/src/sqliteindexer/tests/CMakeLists.txt
++++ b/src/sqliteindexer/tests/CMakeLists.txt
+@@ -3,7 +3,7 @@
+ CREATE_TEST_SOURCELIST(Tests testrunner.cpp SqliteTest.cpp simpletest.cpp)
+ 
+ ADD_EXECUTABLE(sqlitetest ${Tests} )
+-target_link_libraries(sqlitetest streams sqliteindex indexertests)
++target_link_libraries(sqlitetest streams indexertests)
+ 
+ SET (TestsToRun ${Tests})
+ REMOVE (TestsToRun testrunner.cpp)
+--- a/src/sqliteindexer/tests/simpletest.cpp
++++ b/src/sqliteindexer/tests/simpletest.cpp
+@@ -1,5 +1,6 @@
+ #include <strigi/strigiconfig.h>
+-#include "sqliteindexmanager.h"
++#include "indexpluginloader.h"
++#include "indexmanager.h"
+ #include "indexwriter.h"
+ #include "indexreader.h"
+ #include "analyzerconfiguration.h"
+@@ -38,13 +39,14 @@
+     mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR);
+     string p(path);
+     p += "/test.db";
+-    IndexManager* manager = createSqliteIndexManager(p.c_str());
++    Strigi::IndexManager* manager
++        = Strigi::IndexPluginLoader::createIndexManager("sqlite", p.c_str());
+     IndexWriter* writer = manager->indexWriter();
+     IndexReader* reader = manager->indexReader();
+     addAndCount(writer, reader, 1);
+ 
+     // close and clean up the manager
+-    delete manager;
++    Strigi::IndexPluginLoader::deleteIndexManager(manager);
+ 
+     // clean up data
+ /*    std::string cmd = "rm -r ";
+--- a/src/sqliteindexer/tests/SqliteTest.cpp
++++ b/src/sqliteindexer/tests/SqliteTest.cpp
+@@ -1,5 +1,5 @@
+ #include <strigi/strigiconfig.h>
+-#include "sqliteindexmanager.h"
++#include "indexpluginloader.h"
+ #include "indexmanagertests.h"
+ #include "indexwritertests.h"
+ #include "indexreadertests.h"
+@@ -18,7 +18,8 @@
+     mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR);
+     string p(path);
+     p += "/test.db";
+-    Strigi::IndexManager* manager = createSqliteIndexManager(p.c_str());
++    Strigi::IndexManager* manager
++        = Strigi::IndexPluginLoader::createIndexManager("sqlite", p.c_str());
+ 
+     Strigi::AnalyzerConfiguration ic;
+     IndexManagerTests tests(manager, ic);
+@@ -34,7 +35,7 @@
+     rtests.testAll();
+ */
+     // close and clean up the manager
+-    delete manager;
++    Strigi::IndexPluginLoader::deleteIndexManager(manager);
+ 
+     // clean up data
+     std::string cmd = "rm -r ";
+--- a/src/streamanalyzer/classproperties.cpp
++++ b/src/streamanalyzer/classproperties.cpp
+@@ -25,7 +25,6 @@
+ using namespace Strigi;
+ using namespace std;
+ 
+-const string ClassProperties::Private::empty;
+ ClassProperties::ClassProperties() :p(new Private()) {
+ }
+ ClassProperties::ClassProperties(const Private& pr) :p(new Private(pr)) {}
+@@ -70,12 +69,12 @@
+ const string&
+ ClassProperties::localizedName(const string& locale) const {
+     map<string,Localized>::iterator i = p->localized.find(locale);
+-    return (i == p->localized.end()) ?Private::empty :i->second.name;
++    return (i == p->localized.end()) ?empty() :i->second.name;
+ }
+ const string&
+ ClassProperties::localizedDescription(const string& locale) const {
+     map<string,Localized>::iterator i = p->localized.find(locale);
+-    return (i == p->localized.end()) ?Private::empty :i->second.description;
++    return (i == p->localized.end()) ?empty() :i->second.description;
+ }
+ const vector<string>&
+ ClassProperties::parentUris() const {
+--- a/src/streamanalyzer/CMakeLists.txt
++++ b/src/streamanalyzer/CMakeLists.txt
+@@ -26,6 +26,7 @@
+ 	htmlsaxanalyzer.cpp
+ 	id3v2throughanalyzer.cpp
+         indexreader.cpp
++	indexpluginloader.cpp
+ 	lineeventanalyzer.cpp
+ 	m3ustreamanalyzer.cpp
+ 	mimeeventanalyzer.cpp
+@@ -97,6 +98,9 @@
+ 	fieldproperties.h
+ 	fieldtypes.h
+ 	indexeddocument.h
++	indexreader.h
++	indexmanager.h
++	indexplugin.h
+ 	indexwriter.h
+ 	streamanalyzer.h
+ 	streamanalyzerfactory.h
+--- a/src/streamanalyzer/fieldproperties.cpp
++++ b/src/streamanalyzer/fieldproperties.cpp
+@@ -25,7 +25,6 @@
+ using namespace Strigi;
+ using namespace std;
+ 
+-const string FieldProperties::Private::empty;
+ FieldProperties::FieldProperties() :p(new Private()) {
+ }
+ FieldProperties::FieldProperties(const Private& pr) :p(new Private(pr)) {}
+@@ -102,12 +101,12 @@
+ const string&
+ FieldProperties::localizedName(const string& locale) const {
+     map<string,Localized>::iterator i = p->localized.find(locale);
+-    return (i == p->localized.end()) ?Private::empty :i->second.name;
++    return (i == p->localized.end()) ?empty() :i->second.name;
+ }
+ const string&
+ FieldProperties::localizedDescription(const string& locale) const {
+     map<string,Localized>::iterator i = p->localized.find(locale);
+-    return (i == p->localized.end()) ?Private::empty :i->second.description;
++    return (i == p->localized.end()) ?empty() :i->second.description;
+ }
+ const vector<string>&
+ FieldProperties::parentUris() const {
+--- a/src/streamanalyzer/fieldpropertiesdb.cpp
++++ b/src/streamanalyzer/fieldpropertiesdb.cpp
+@@ -47,8 +47,8 @@
+ public:
+     map<string, FieldProperties> properties;
+     map<string, ClassProperties> classes;
+-    static FieldProperties emptyField;
+-    static ClassProperties emptyClass;
++    static const FieldProperties& emptyField();
++    static const ClassProperties& emptyClass();
+ 
+     Private();
+     static vector<string> getdirs(const string&);
+@@ -94,8 +94,16 @@
+ 
+ };
+ 
+-FieldProperties FieldPropertiesDb::Private::emptyField;
+-ClassProperties FieldPropertiesDb::Private::emptyClass;
++const FieldProperties&
++FieldPropertiesDb::Private::emptyField() {
++    static const FieldProperties e;
++    return e;
++}
++const ClassProperties&
++FieldPropertiesDb::Private::emptyClass() {
++    static const ClassProperties f;
++    return f;
++}
+ 
+ FieldPropertiesDb&
+ FieldPropertiesDb::db() {
+@@ -112,7 +120,7 @@
+     map<std::string, FieldProperties>::const_iterator j
+         = p->properties.find(uri);
+     if (j == p->properties.end()) {
+-        return FieldPropertiesDb::Private::emptyField;
++        return FieldPropertiesDb::Private::emptyField();
+     } else {
+         return j->second;
+     }
+@@ -126,7 +134,7 @@
+ FieldPropertiesDb::classes(const std::string& uri) const {
+     map<std::string, ClassProperties>::const_iterator j = p->classes.find(uri);
+     if (j == p->classes.end()) {
+-        return FieldPropertiesDb::Private::emptyClass;
++        return FieldPropertiesDb::Private::emptyClass();
+     } else {
+         return j->second;
+     }
+@@ -255,6 +263,9 @@
+     props.uri = FieldRegister::filenameFieldName;
+     properties[FieldRegister::filenameFieldName] = props;
+ 
++    props.uri = FieldRegister::mimetypeFieldName;
++    properties[FieldRegister::mimetypeFieldName] = props;
++
+     props.uri = FieldRegister::parentLocationFieldName;
+     props.tokenized = false;
+     properties[FieldRegister::parentLocationFieldName] = props;
+--- a/src/streamanalyzer/fieldproperties_private.h
++++ b/src/streamanalyzer/fieldproperties_private.h
+@@ -24,12 +24,18 @@
+ #include "fieldproperties.h"
+ #include "fieldtypes.h"
+ 
++namespace {
++    const std::string& empty() {
++        static std::string e;
++        return e;
++    }
++}
++
+ namespace Strigi {
+ 
+ class FieldProperties::Private {
+ friend class FieldPropertiesDb;
+ public:
+-    static const std::string empty;
+     std::string uri;
+     std::string name;
+     std::string typeuri;
+@@ -69,7 +75,6 @@
+ class ClassProperties::Private {
+ friend class FieldPropertiesDb;
+ public:
+-    static const std::string empty;
+     std::string uri;
+     std::string name;
+     std::string description;
+--- a/src/streamanalyzer/filelister.cpp
++++ b/src/streamanalyzer/filelister.cpp
+@@ -47,34 +47,37 @@
+ using namespace std;
+ using namespace Strigi;
+ 
+-/*!
+-* @param path string containing path to check
+-* Appends the terminating char to path.
+-* Under Windows that char is '\', '/' under *nix
+-*/
+-string fixPath (string path)
++namespace
+ {
+-    if ( path.c_str() == NULL || path.length() == 0 )
+-        return "";
+-
+-    string temp(path);
+-
+-#ifdef HAVE_WINDOWS_H
+-    size_t l= temp.length();
+-    char* t = (char*)temp.c_str();
+-    for (size_t i=0;i<l;i++){
+-        if ( t[i] == '\\' )
+-            t[i] = '/';
+-    }
+-    temp[0] = tolower(temp.at(0));
+-#endif
++    /*!
++    * @param path string containing path to check
++    * Appends the terminating char to path.
++    * Under Windows that char is '\', '/' under *nix
++    */
++    string fixPath (string path)
++    {
++        if ( path.c_str() == NULL || path.length() == 0 )
++            return "";
++
++        string temp(path);
++
++    #ifdef HAVE_WINDOWS_H
++        size_t l= temp.length();
++        char* t = (char*)temp.c_str();
++        for (size_t i=0;i<l;i++){
++            if ( t[i] == '\\' )
++                t[i] = '/';
++        }
++        temp[0] = tolower(temp.at(0));
++    #endif
+ 
+-    char separator = '/';
++        char separator = '/';
+ 
+-    if (temp[temp.length() - 1 ] != separator)
+-        temp += separator;
++        if (temp[temp.length() - 1 ] != separator)
++            temp += separator;
+ 
+-    return temp;
++        return temp;
++    }
+ }
+ 
+ class FileLister::Private {
+--- a/src/streamanalyzer/filelister.h
++++ b/src/streamanalyzer/filelister.h
+@@ -45,7 +45,6 @@
+ 
+ namespace Strigi {
+ 
+-
+ class FileLister {
+ private:
+     class Private;
+@@ -72,7 +71,7 @@
+     void skipTillAfter(const std::string& lastToSkip);
+ };
+ 
+-class DirLister {
++class STRIGI_EXPORT DirLister {
+ private:
+     class Private;
+     Private* p;
+--- a/src/streamanalyzer/indexmanager.h
++++ b/src/streamanalyzer/indexmanager.h
+@@ -24,6 +24,9 @@
+ class IndexReader;
+ class IndexWriter;
+ 
++class IndexManager;
++void deleteIndexManager(Strigi::IndexManager* m);
++
+ /**
+  * Abstract interface that manages access to the IndexReader and IndexWriter
+  * instances provided by a particular index backend.
+@@ -38,6 +41,7 @@
+  * be used in the active thread.
+  **/
+ class IndexManager {
++friend void deleteIndexManager(Strigi::IndexManager* m);
+ public:
+     virtual ~IndexManager() {}
+     /**
+--- /dev/null
++++ b/src/streamanalyzer/indexplugin.h
+@@ -0,0 +1,40 @@
++/* This file is part of Strigi Desktop Search
++ *
++ * Copyright (C) 2007 Jos van den Oever <jos at vandenoever.info>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public License
++ * along with this library; see the file COPYING.LIB.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ * Boston, MA 02110-1301, USA.
++ */
++
++#ifndef STRIGI_INDEXPLUGIN_H
++#define STRIGI_INDEXPLUGIN_H
++#include <strigi/strigiconfig.h>
++
++/**
++ * @brief Macro to register functions for creating and deleting an indexmanager
++ *        in a plugin
++ *
++ * @param CLASS the name of the subclass of Strigi::IndexManager
++ */
++#define REGISTER_STRIGI_INDEXMANAGER(CLASS) extern "C" { \
++    STRIGI_EXPORT Strigi::IndexManager* createIndexManager(const char* dir) { \
++        return new CLASS(dir); \
++    } \
++    STRIGI_EXPORT void deleteIndexManager(Strigi::IndexManager* m) { \
++        delete m; \
++    } \
++}
++#endif
++
+--- /dev/null
++++ b/src/streamanalyzer/indexpluginloader.cpp
+@@ -0,0 +1,216 @@
++/* This file is part of Strigi Desktop Search
++ *
++ * Copyright (C) 2007 Jos van den Oever <jos at vandenoever.info>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public License
++ * along with this library; see the file COPYING.LIB.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ * Boston, MA 02110-1301, USA.
++ */
++#include "indexpluginloader.h" 
++#include "indexmanager.h"
++#include <iostream>
++#include <stgdirent.h>
++#include <sys/stat.h>
++using namespace std;
++using namespace Strigi;
++
++#ifndef _WIN32
++#include <dlfcn.h>
++#define DLSYM dlsym
++#define DLCLOSE dlclose
++#else
++#define DLSYM GetProcAddress
++#define DLCLOSE FreeLibrary
++#endif
++
++#ifndef _WIN32
++typedef void* StgModuleType;
++#else
++#include <windows.h>
++typedef HMODULE StgModuleType;
++#endif
++
++// anonymous namespace for static variables
++namespace {
++    class Module {
++    private:
++        const StgModuleType mod;
++        Module(const Module&);
++        void operator=(const Module&);
++    public:
++        Strigi::IndexManager* (*create)(const char*);
++        void (*destroy)(Strigi::IndexManager*);
++        Module(StgModuleType m)
++            :mod(m) {}
++        ~Module() {
++// TODO: figure out why we get segfaults when cleaning up nicely
++//            DLCLOSE(mod);
++        }
++    };
++    class ModuleList {
++    public:
++        map<std::string, Module*> modules;
++        map<void*, Module*> indexmanagers;
++
++        ModuleList() {
++            // load the plugins from the environment setting
++            const char* strigipluginpath(getenv("STRIGI_PLUGIN_PATH"));
++            if (strigipluginpath) {
++                IndexPluginLoader::loadPlugins(strigipluginpath);
++            } else {
++                IndexPluginLoader::loadPlugins( LIBINSTALLDIR "/strigi");
++            }
++        }
++        ~ModuleList() {
++            // delete all leftover indexmanagers
++            // if code deletes the indexmanager on it's own, the error will
++            // appear here
++            map<void*, Module*>::iterator j;
++            for (j = indexmanagers.begin(); j != indexmanagers.end(); ++j) {
++                j->second->destroy(static_cast<IndexManager*>(j->first));
++            }
++            // unload all the modules
++            map<string, Module*>::iterator i;
++            for (i = modules.begin(); i != modules.end(); ++i) {
++                delete i->second;
++            }
++        }
++        void loadModule(const string& name, const string& dir);
++    };
++    void
++    ModuleList::loadModule(const string& name, const string& lib) {
++        // check if this module was already loaded
++        map<string, Module*>::iterator i = modules.find(name);
++        if (i != modules.end()) {
++            return;
++        }
++        StgModuleType handle;
++#ifdef HAVE_DLFCN_H
++        // do not use RTLD_GLOBAL here
++        // note: If neither RTLD_GLOBAL nor RTLD_LOCAL are specified,
++        // the default is RTLD_LOCAL.
++        handle = dlopen(lib.c_str(), RTLD_LAZY);
++#else
++        handle = LoadLibrary(lib.c_str());
++#endif
++        if (!handle) {
++#ifdef HAVE_DLFCN_H
++            cerr << "Could not load '" << lib << "':" << dlerror() << endl;
++#else
++            cerr << "Could not load '" << lib << "': GetLastError(): "
++                << GetLastError() << endl;
++#endif
++            return;
++        }
++        IndexManager*(*create)(const char*) = (IndexManager*(*)(const char*))
++            DLSYM(handle, "createIndexManager");
++        if (!create) {
++#ifndef WIN32
++            fprintf(stderr, "%s\n", dlerror());
++#else
++            fprintf(stderr, "GetLastError: %d\n", GetLastError());
++#endif
++            DLCLOSE(handle);
++            return;
++        }
++        void(*destroy)(IndexManager*) = (void(*)(IndexManager*))
++            DLSYM(handle, "deleteIndexManager");
++        if (!destroy) {
++#ifndef WIN32
++            fprintf(stderr, "%s\n", dlerror());
++#else
++            fprintf(stderr, "GetLastError: %d\n", GetLastError());
++#endif
++            DLCLOSE(handle);
++            return;
++        }
++        Module* module = new Module(handle);
++        module->create = create;
++        module->destroy = destroy;
++        modules[name] = module;
++    }
++    static ModuleList modules;
++}
++void
++IndexPluginLoader::loadPlugins(const char* d) {
++    DIR *dir = opendir(d);
++    if (dir == 0) {
++        return;
++    }
++    struct dirent* ent = readdir(dir);
++    string prefix("strigiindex_");
++#ifdef WIN32
++    string suffix(".dll");
++#else
++    string suffix(".so");
++#endif
++    while(ent) {
++        size_t len = strlen(ent->d_name);
++        const char* prepos = strstr(ent->d_name, prefix.c_str());
++        const char* sufpos = strstr(ent->d_name, suffix.c_str());
++        if (prepos && sufpos + suffix.length() == ent->d_name + len) {
++            len -= (prepos - ent->d_name) + prefix.length() + suffix.length();
++            string name(prepos + prefix.length(), len);
++            string pluginpath = d;
++            if (pluginpath[pluginpath.length()-1] != '/') {
++                pluginpath.append("/");
++            }
++            pluginpath.append(ent->d_name);
++            // check that the file is a regular file
++            struct stat s;
++            if (stat(pluginpath.c_str(), &s) == 0 && (S_IFREG & s.st_mode)) {
++                modules.loadModule(name, pluginpath);
++            }
++        }
++        ent = readdir(dir);
++    }
++    closedir(dir);
++}
++vector<string>
++IndexPluginLoader::indexNames() {
++    vector<string> names;
++    map<string, Module*>::const_iterator i = modules.modules.begin();
++    for (; i != modules.modules.end(); ++i) {
++        names.push_back(i->first);
++    }
++    return names;
++}
++IndexManager*
++IndexPluginLoader::createIndexManager(const char* name, const char* dir) {
++    // find the right plugin
++    map<string, Module*>::iterator i = modules.modules.find(name);
++    if (i == modules.modules.end()) {
++        return 0;
++    }
++    // create the indexmanager
++    IndexManager* im = i->second->create(dir);
++    if (im) {
++        // map the indexmanager to the module that created it, so we can delete
++        // it later
++        modules.indexmanagers[im] = i->second;
++    }
++    return im;
++}
++void
++IndexPluginLoader::deleteIndexManager(IndexManager* im) {
++    // find the right module
++    map<void*, Module*>::iterator i = modules.indexmanagers.find(im);
++    if (i == modules.indexmanagers.end()) {
++        return;
++    }
++    // let the module delete the indexmanager
++    i->second->destroy(im);
++    // remove the mapping from the map
++    modules.indexmanagers.erase(i);
++}
+--- /dev/null
++++ b/src/streamanalyzer/indexpluginloader.h
+@@ -0,0 +1,34 @@
++/* This file is part of Strigi Desktop Search
++ *
++ * Copyright (C) 2007 Jos van den Oever <jos at vandenoever.info>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Library General Public
++ * License as published by the Free Software Foundation; either
++ * version 2 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Library General Public License for more details.
++ *
++ * You should have received a copy of the GNU Library General Public License
++ * along with this library; see the file COPYING.LIB.  If not, write to
++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++ * Boston, MA 02110-1301, USA.
++ */
++#include <strigi/strigiconfig.h>
++#include <vector>
++#include <map>
++#include <string>
++
++namespace Strigi {
++  class IndexManager;
++  namespace IndexPluginLoader {
++    STRIGI_EXPORT void loadPlugins(const char* dir);
++    STRIGI_EXPORT std::vector<std::string> indexNames();
++    STRIGI_EXPORT Strigi::IndexManager* createIndexManager(const char* name,
++        const char* dir);
++    STRIGI_EXPORT void deleteIndexManager(Strigi::IndexManager* manager);
++  }
++}
+--- a/src/streamanalyzer/indexreader.h
++++ b/src/streamanalyzer/indexreader.h
+@@ -79,7 +79,7 @@
+      *                 @p parent will be placed.
+      **/
+     virtual void getChildren(const std::string& parent,
+-            std::map<std::string, time_t>& children) {}
++            std::map<std::string, time_t>& children) {};
+     /**
+      * Count the number of documents indexed in the index.
+      *
+--- a/src/streamanalyzer/queryparser.cpp
++++ b/src/streamanalyzer/queryparser.cpp
+@@ -120,7 +120,19 @@
+     }
+     return space+1;
+ }
+-
++void
++prependXesamNamespace(Query& query) {
++    // prepend the field names with the xesam namespace
++    // this will be elaborated once the xesam spec continues
++    vector<string>::iterator end(query.fields().end());
++    for (vector<string>::iterator i = query.fields().begin(); i != end; ++i) {
++        *i = "http://freedesktop.org/standards/xesam/1.0/core#" + *i;
++    }
++    std::vector<Query>::iterator qend(query.subQueries().end());
++    for (vector<Query>::iterator i = query.subQueries().begin(); i!=qend; ++i) {
++        prependXesamNamespace(*i);
++    }
++}
+ Query
+ QueryParser::buildQuery(const std::string& q) {
+     Query query;
+@@ -140,14 +152,7 @@
+         Query q = query.subQueries()[0];
+         query = q;
+     }
++    prependXesamNamespace(query);
+ 
+-    // prepend the field names with the xesam namespace
+-    // this will be elaborated once the xesam spec continues
+-    vector<string>::iterator end(query.fields().end());
+-    for (vector<string>::iterator i = query.fields().begin(); i != end; ++i) {
+-         *i = "http://freedesktop.org/standards/xesam/1.0/core#" + *i;
+-    }
+-    //cerr << "query: '" << q << "' : " << query.subQueries().size() << "'"
+-    //    << query.term().string() << "'" << endl;
+     return query;
+ }
+--- a/src/strigicmd/strigicmd.cpp
++++ b/src/strigicmd/strigicmd.cpp
+@@ -18,7 +18,8 @@
+  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+  * Boston, MA 02110-1301, USA.
+  */
+-#include "combinedindexmanager.h"
++#include "indexpluginloader.h"
++#include "indexmanager.h"
+ #include "indexreader.h"
+ #include "indexwriter.h"
+ #include "indexeddocument.h"
+@@ -154,6 +155,10 @@
+ }
+ void
+ printBackends(const string& msg, const vector<string> backends) {
++    if (backends.size() == 0) {
++        pe(" No backends are available.\n");
++        return;
++    }
+     pe(msg.c_str());
+     pe(" Choose one from ");
+     for (uint j=0; j<backends.size()-1; ++j) {
+@@ -218,7 +223,7 @@
+ IndexManager*
+ getIndexManager(string& backend, const string& indexdir) {
+     // check arguments: backend
+-    const vector<string>& backends = CombinedIndexManager::backEnds();
++    const vector<string>& backends = IndexPluginLoader::indexNames();
+     // if there is only one backend, the backend does not have to be specified
+     if (backend.size() == 0) {
+         if (backends.size() == 1) {
+@@ -230,11 +235,13 @@
+     }
+     vector<string>::const_iterator b
+         = find(backends.begin(), backends.end(), backend);
++cerr << "n backends: " << backends.size() << endl;
+     if (b == backends.end()) {
+         printBackends("Invalid index type.", backends);
+         return 0;
+     }
+-    return CombinedIndexManager::factories()[backend](indexdir.c_str());
++    return IndexPluginLoader::createIndexManager(backend.c_str(),
++        indexdir.c_str());
+ }
+ int
+ create(int argc, char** argv) {
+@@ -286,7 +293,7 @@
+         analyzer->analyzeDir(j->c_str(), nthreads);
+     }
+     delete analyzer;
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+ 
+     return 0;
+ }
+@@ -329,7 +336,7 @@
+     DirAnalyzer* analyzer = new DirAnalyzer(*manager, config);
+     analyzer->updateDirs(arguments, nthreads);
+     delete analyzer;
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+ 
+     return 0;
+ }
+@@ -363,7 +370,7 @@
+     }
+     IndexReader* reader = manager->indexReader();
+     listFiles(reader, "");
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+@@ -411,7 +418,7 @@
+         }
+     }
+     
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+@@ -478,7 +485,7 @@
+         }
+     }
+     
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+@@ -572,7 +579,7 @@
+     if (results != 0)
+         printf ("Query returned %i results\n", results);
+ 
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+@@ -645,7 +652,7 @@
+         writer->optimize();
+     }
+     
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+@@ -672,7 +679,7 @@
+     for (i=fields.begin(); i!=fields.end(); ++i) {
+         printf("%s\n", i->c_str());
+     }
+-    delete manager;
++    IndexPluginLoader::deleteIndexManager(manager);
+     return 0;
+ }
+ int
+--- a/tests/daemon/CMakeLists.txt
++++ b/tests/daemon/CMakeLists.txt
+@@ -1,8 +1,5 @@
+ # add a test for the daemon configuration loading classes
+ 
+-# fancy way of saying set(INC_DIR test/daemon)
+-string(REGEX REPLACE /test /src INC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+-
+ # if we use log4cxx, include it
+ # ideally this should be abstracted away in something like STRIGILOG( ... )
+ if (ENABLE_LOG4CXX AND Log4cxx_FOUND)
+--- a/tests/estraierindexer/CMakeLists.txt
++++ b/tests/estraierindexer/CMakeLists.txt
+@@ -1,5 +1,3 @@
+-STRING(REGEX REPLACE /test /src INC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+-
+ if (ENABLE_LOG4CXX AND Log4cxx_FOUND)
+     set(estraiertest_LIBS ${estraiertest_LIBS} ${LOG4CXX_LIBRARIES})
+     set (INC_DIR ${INC_DIR} ${LOG4CXX_INCLUDE_DIR})
+@@ -12,6 +10,7 @@
+                      ${strigi_SOURCE_DIR}/src/streams
+                      ${strigi_BINARY_DIR}/src/streams
+                      ${strigi_SOURCE_DIR}/src/streams/strigi
++                     ${strigi_SOURCE_DIR}/src/estraierindexer
+                      ${EST_INCLUDE_DIR}
+ )
+ 
+--- a/tests/indextesters/indexmanagertester.cpp
++++ b/tests/indextesters/indexmanagertester.cpp
+@@ -27,6 +27,7 @@
+ #include "fieldtypes.h"
+ #include "query.h"
+ #include "queryparser.h"
++#include "indexpluginloader.h"
+ 
+ #include <sstream>
+ #include <sys/stat.h>
+@@ -53,7 +54,7 @@
+ 
+ void IndexManagerTester::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ }
+ 
+ 
+--- a/tests/indextesters/indexreadertester.cpp
++++ b/tests/indextesters/indexreadertester.cpp
+@@ -28,6 +28,7 @@
+ #include "analyzerconfiguration.h"
+ #include "query.h"
+ #include "queryparser.h"
++#include "indexpluginloader.h"
+ 
+ #include <string>
+ #include <sstream>
+@@ -65,7 +66,7 @@
+ 
+ void IndexReaderTester::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ }
+ 
+ void
+--- a/tests/indextesters/indexsearchtester.cpp
++++ b/tests/indextesters/indexsearchtester.cpp
+@@ -27,6 +27,7 @@
+ #include "query.h"
+ #include "queryparser.h"
+ #include "unittestfunctions.h"
++#include "indexpluginloader.h"
+ 
+ #include  <errno.h>
+ #include <fstream>
+@@ -125,8 +126,9 @@
+ 
+ void
+ IndexSearchTester::tearDown() {
+-    if (manager)
+-        delete manager;
++    if (manager) {
++        Strigi::IndexPluginLoader::deleteIndexManager(manager);
++    }
+     manager = NULL;
+     
+     // clean up data (does not work on windows)
+--- a/tests/indextesters/indexwritertester.cpp
++++ b/tests/indextesters/indexwritertester.cpp
+@@ -28,6 +28,7 @@
+ #include "analyzerconfiguration.h"
+ #include "query.h"
+ #include "queryparser.h"
++#include "indexpluginloader.h"
+ 
+ #include <string>
+ #include <sstream>
+@@ -63,7 +64,7 @@
+ 
+ void IndexWriterTester::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ }
+ 
+ 
+--- a/tests/luceneindexer/CMakeLists.txt
++++ b/tests/luceneindexer/CMakeLists.txt
+@@ -1,5 +1,3 @@
+-STRING(REGEX REPLACE /test /src INC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+-
+ if (ENABLE_LOG4CXX AND Log4cxx_FOUND)
+     set(lucenetest_LIBS ${lucenetest_LIBS} ${LOG4CXX_LIBRARIES})
+     set (INC_DIR ${INC_DIR} ${LOG4CXX_INCLUDE_DIR})
+@@ -10,7 +8,6 @@
+                      ../indextesters
+                      ../streamanalyzer
+                      ${strigi_SOURCE_DIR}/src/streamanalyzer
+-                     ${strigi_SOURCE_DIR}/src/luceneindexer
+                      ${strigi_SOURCE_DIR}/src/streams
+                      ${strigi_BINARY_DIR}/src/streams
+                      ${strigi_SOURCE_DIR}/src/streams/strigi
+@@ -27,7 +24,6 @@
+ target_link_libraries (lucenetest   test_runner
+                                     streamanalyzertesters
+                                     indextesters
+-                                    cluceneindex
+                                     ${lucenetest_LIBS})
+ 
+ add_test (lucenetests lucenetest)
+--- a/tests/luceneindexer/luceneindexmanagertest.cpp
++++ b/tests/luceneindexer/luceneindexmanagertest.cpp
+@@ -21,9 +21,9 @@
+ 
+ #include "analysisresult.h"
+ #include "analyzerconfiguration.h"
+-#include "cluceneindexmanager.h"
+ #include "indexwriter.h"
+ #include "indexreader.h"
++#include "indexpluginloader.h"
+ #include "query.h"
+ 
+ #include <sys/stat.h>
+@@ -49,13 +49,13 @@
+ #else
+     mkdir(path.c_str(), S_IRUSR|S_IWUSR|S_IXUSR);
+ #endif
+-
+-    return createCLuceneIndexManager(path.c_str());
++    return
++        Strigi::IndexPluginLoader::createIndexManager("clucene", path.c_str());
+ }
+ 
+ void LuceneIndexManagerTest::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ 
+     // clean up data
+     system("rm -r testcluceneindex");
+--- a/tests/luceneindexer/luceneindexreadertest.cpp
++++ b/tests/luceneindexer/luceneindexreadertest.cpp
+@@ -21,10 +21,10 @@
+ 
+ #include "analysisresult.h"
+ #include "analyzerconfiguration.h"
+-#include "cluceneindexmanager.h"
+ #include "indexwriter.h"
+ #include "indexreader.h"
+ #include "query.h"
++#include "indexpluginloader.h"
+ 
+ #include <string>
+ #include <sstream>
+@@ -52,12 +52,13 @@
+     mkdir(path.c_str(), S_IRUSR|S_IWUSR|S_IXUSR);
+ #endif
+ 
+-    return createCLuceneIndexManager(path.c_str());
++    return
++        Strigi::IndexPluginLoader::createIndexManager("clucene", path.c_str());
+ }
+ 
+ void LuceneIndexReaderTest::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ 
+     // clean up data
+     system("rm -r testcluceneindex");
+--- a/tests/luceneindexer/luceneindexwritertest.cpp
++++ b/tests/luceneindexer/luceneindexwritertest.cpp
+@@ -21,8 +21,8 @@
+ 
+ #include "analysisresult.h"
+ #include "analyzerconfiguration.h"
+-#include "cluceneindexmanager.h"
+ #include "indexwriter.h"
++#include "indexpluginloader.h"
+ #include "query.h"
+ 
+ #include <string>
+@@ -51,12 +51,13 @@
+     mkdir(path.c_str(), S_IRUSR|S_IWUSR|S_IXUSR);
+ #endif
+ 
+-    return createCLuceneIndexManager(path.c_str());
++    return
++        Strigi::IndexPluginLoader::createIndexManager("clucene", path.c_str());
+ }
+ 
+ void LuceneIndexWriterTest::deleteManager( Strigi::IndexManager* m )
+ {
+-    delete m;
++    Strigi::IndexPluginLoader::deleteIndexManager(m);
+ 
+     // clean up data
+     system("rm -r testcluceneindex");
+--- a/tests/streamanalyzer/diranalyzertester.cpp
++++ b/tests/streamanalyzer/diranalyzertester.cpp
+@@ -23,6 +23,7 @@
+ #include "diranalyzer.h"
+ #include "indexmanager.h"
+ #include "indexreader.h"
++#include "indexpluginloader.h"
+ #include "unittestfunctions.h"
+ 
+ #include <errno.h>
+@@ -105,8 +106,9 @@
+ 
+ void DirAnalyzerTester::tearDown()
+ {
+-    if (manager)
+-        delete manager;
++    if (manager) {
++        Strigi::IndexPluginLoader::deleteIndexManager(manager);
++    }
+     manager = NULL;
+ 
+     // clean up data
+--- a/tests/utils/CMakeLists.txt
++++ b/tests/utils/CMakeLists.txt
+@@ -1,8 +1,9 @@
+ include_directories (   .
++                        ${strigi_BINARY_DIR}/src/streams
+                         ${strigi_SOURCE_DIR}/src/streamanalyzer
+                         ${strigi_SOURCE_DIR}/src/combinedindexer
+                     )
+ 
+ add_library(unittestfunctions unittestfunctions.cpp)
+ 
+-target_link_libraries (unittestfunctions combinedindex)
+\ No newline at end of file
++target_link_libraries (unittestfunctions combinedindex)
+--- a/tests/utils/unittestfunctions.cpp
++++ b/tests/utils/unittestfunctions.cpp
+@@ -21,22 +21,14 @@
+ #include "unittestfunctions.h"
+ 
+ #include "indexmanager.h"
+-#include "combinedindexmanager.h"
++#include "indexpluginloader.h"
+ #include <vector>
+ #include <algorithm>
+ 
+ using namespace std;
+ 
+ Strigi::IndexManager* strigiunittest::getIndexManager(string& backend,
+-                                                      const string& indexdir)
+-{
+-    // check arguments: backend
+-    const vector<string>& backends = CombinedIndexManager::backEnds();
+-
+-    vector<string>::const_iterator b
+-            = find(backends.begin(), backends.end(), backend);
+-    if (b == backends.end())
+-        return 0;
+-
+-    return CombinedIndexManager::factories()[backend](indexdir.c_str());
++                                                      const string& indexdir) {
++    return Strigi::IndexPluginLoader::createIndexManager(backend.c_str(),
++        indexdir.c_str());
+ }

Added: kde-extras/strigi/trunk/debian/patches/series
===================================================================
--- kde-extras/strigi/trunk/debian/patches/series	                        (rev 0)
+++ kde-extras/strigi/trunk/debian/patches/series	2007-10-20 15:40:40 UTC (rev 7603)
@@ -0,0 +1,2 @@
+01_strigi_branch_r726017.diff
+

Modified: kde-extras/strigi/trunk/debian/rules
===================================================================
--- kde-extras/strigi/trunk/debian/rules	2007-10-20 14:04:10 UTC (rev 7602)
+++ kde-extras/strigi/trunk/debian/rules	2007-10-20 15:40:40 UTC (rev 7603)
@@ -6,7 +6,7 @@
 
 include debian/cmake.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 include /usr/share/cdbs/1/rules/utils.mk
 
 #DEB_CMAKE_EXTRA_FLAGS = -DCMAKE_BUILD_TYPE=debugfull -DENABLE_DBUS:BOOL=ON -DENABLE_INOTIFY:BOOL=OFF -DENABLE_LOG4CXX:BOOL=OFF

Added: kde-extras/strigi/trunk/debian/strigi-index-plugins.install
===================================================================
--- kde-extras/strigi/trunk/debian/strigi-index-plugins.install	                        (rev 0)
+++ kde-extras/strigi/trunk/debian/strigi-index-plugins.install	2007-10-20 15:40:40 UTC (rev 7603)
@@ -0,0 +1 @@
+usr/lib/strigi/strigiindex_clucene.so

Deleted: kde-extras/strigi/trunk/debian/watch




More information about the pkg-kde-commits mailing list