Nepomuk-Core
indexcleaner.cpp
Go to the documentation of this file.
64 filters << QString::fromLatin1( "(?url!=%1)" ).arg( Soprano::Node::resourceToN3( KUrl( folder ) ) );
123 const QString fileFilters = constructExcludeFiltersFilenameFilter(Nepomuk2::FileIndexerConfig::self());
124 const QString includeExcludeFilters = constructExcludeIncludeFoldersFilter(Nepomuk2::FileIndexerConfig::self()->includeFolders());
128 filters = QString::fromLatin1("FILTER((%1) && (%2)) .").arg( includeExcludeFilters, fileFilters );
150 const QString excludeFiltersFolderFilter = constructExcludeFiltersFolderFilter(Nepomuk2::FileIndexerConfig::self());
187 = ResourceManager::instance()->mainModel()->executeQuery( m_query, Soprano::Query::QueryLanguageSparqlNoInference );
196 connect( job, SIGNAL(finished(KJob*)), this, SLOT(slotRemoveResourcesDone(KJob*)), Qt::QueuedConnection );
259 return '(' + subFilters.join( include ? QLatin1String( " || " ) : QLatin1String( " && " ) ) + ')';
305 // 1. A set of filter terms which exlude the actual include folders themselves from being removed
336 QString Nepomuk2::IndexCleaner::constructExcludeFiltersFilenameFilter(Nepomuk2::FileIndexerConfig *cfg)
344 fileFilters << QString::fromLatin1( "REGEX(STR(?fn),\"^%1$\")" ).arg( excludeFilterToSparqlRegex(filter) );
351 QString Nepomuk2::IndexCleaner::constructExcludeFiltersFolderFilter(Nepomuk2::FileIndexerConfig *cfg)
354 // In order to find the entries which we should remove based on matching exclude filters in path
356 // 1. For each exclude filter find entries which contain "/FILTER/" in their URL. The ones which
358 // 2. If there are include folders which have a path component matching one of the exclude filters
359 // we need to add additional filter terms to make sure we do not remove any of the files in them.
360 // 2.1. The exception are URLs that have a path component which matches one of the exclude filters
371 // Find all the include folders that have a path component which should normally be excluded through
395 terms << QString::fromLatin1( "REGEX(STR(?url),'/%1/')" ).arg( excludeFilterToSparqlRegex(filter) );
401 terms << QString::fromLatin1("(!REGEX(STR(?url),'^%1/') || REGEX(bif:substring(STR(?url),%2,10000),'/%3/'))")
412 // Combine the generated filter terms with the typical include folder exclusion filter which makes
static QString constructExcludeFiltersFolderFilter(Nepomuk2::FileIndexerConfig *cfg)
Construct a SPARQL filter which matches all file URLs (variable ?url) that should not be indexed acco...
Definition: indexcleaner.cpp:351
void rebuildCacheFromFilterList(const QStringList &filters)
Definition: regexpcache.cpp:60
QStringList excludeFilters() const
Definition: fileindexerconfig.cpp:116
QStringList includeFolders() const
The folders to search for files to analyze.
Definition: fileindexerconfig.cpp:94
Active config class which emits signals if the config was changed, for example if the KCM saved the c...
Definition: fileindexerconfig.h:38
static QString constructExcludeFolderFilter(Nepomuk2::FileIndexerConfig *cfg)
Construct a SPARQL filter which matches all URLs (variable ?url) that should not be indexed according...
Definition: indexcleaner.cpp:301
KJob * clearIndexedData(const QUrl &url)
remove all indexed data for url the datamanagement way
Definition: util.cpp:42
QList< QPair< QString, bool > > folders() const
A cleaned up list of all include and exclude folders with their respective include/exclude flag sorte...
Definition: fileindexerconfig.cpp:88
Definition: regexpcache.h:30
static ResourceManager * instance()
Definition: resourcemanager.cpp:270
static QString constructExcludeFiltersFilenameFilter(Nepomuk2::FileIndexerConfig *cfg)
Construct a SPARQL filter which matches all filenames (variable ?fn) that match one of the exclude fi...
Definition: indexcleaner.cpp:336
static FileIndexerConfig * self()
Get the first created instance of FileIndexerConfig.
Definition: fileindexerconfig.cpp:82
Soprano::Model * mainModel()
Retrieve the main data storage model.
Definition: resourcemanager.cpp:363
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.