3 * $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
5 * This file is part of the Nepomuk KDE project.
6 * Copyright (C) 2006-2007 Sebastian Trueg <trueg@kde.org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 * See the file "COPYING" for the exact licensing terms.
15 #ifndef _REPOSITORY_H_
16 #define _REPOSITORY_H_
18 #include <QtCore/QString>
19 #include <QtCore/QMap>
21 #include <Soprano/Util/SignalCacheModel>
28 class IndexFilterModel
;
37 class CLuceneAnalyzer
;
39 class Repository
: public Soprano::Util::SignalCacheModel
44 Repository( const QString
& name
);
47 QString
name() const { return m_name
; }
57 static const Soprano::Backend
* activeSopranoBackend();
61 * Will emit the opened signal
68 * Calls slotDoOptimize via timer for instant return.
73 void opened( Repository
*, bool success
);
76 void copyFinished( KJob
* job
);
77 void rebuildingIndexFinished();
78 void slotDoOptimize();
82 * \return true if the index needs to be rebuilt and the method
83 * took over initialization.
85 bool rebuildIndexIfNecessary();
90 // the base path for the data. Will contain subfolders:
91 // "index" for the fulltext index
92 // "data" for the data
95 const Soprano::Backend
* m_oldStorageBackend
;
96 QString m_oldStoragePath
;
98 Soprano::Model
* m_model
;
99 Nepomuk::CLuceneAnalyzer
* m_analyzer
;
100 Soprano::Index::CLuceneIndex
* m_index
;
101 Soprano::Index::IndexFilterModel
* m_indexModel
;
104 typedef QMap
<QString
, Repository
*> RepositoryMap
;