diff options
| author | Peter Penz <[email protected]> | 2011-02-03 17:23:45 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-02-03 17:23:45 +0100 |
| commit | b1843402863d0473b00d872daec4ab382ddec030 (patch) | |
| tree | 8dc2c2fcc8d7b9c4e640f30b13f33a37a78f3506 /src/search/dolphinsearchinformation.cpp | |
| parent | 687f40b54564a99b734dac4a5328b848c4795206 (diff) | |
Use KUrl::isParentOf() instead of doing custom QString-operations
This fixes the issue that a directory might be declared as indexed/non-indexed although it just starts with a similar name like another directory.
Diffstat (limited to 'src/search/dolphinsearchinformation.cpp')
| -rw-r--r-- | src/search/dolphinsearchinformation.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/search/dolphinsearchinformation.cpp b/src/search/dolphinsearchinformation.cpp index 2cba5a147..28863034b 100644 --- a/src/search/dolphinsearchinformation.cpp +++ b/src/search/dolphinsearchinformation.cpp @@ -53,15 +53,14 @@ bool DolphinSearchInformation::isIndexingEnabled() const bool DolphinSearchInformation::isPathIndexed(const KUrl& url) const { #ifdef HAVE_NEPOMUK - const QString path = url.path(); - const KConfig strigiConfig("nepomukstrigirc"); const QStringList indexedFolders = strigiConfig.group("General").readPathEntry("folders", QStringList()); // Check whether the path is part of an indexed folder bool isIndexed = false; foreach (const QString& indexedFolder, indexedFolders) { - if (path.startsWith(indexedFolder)) { + const KUrl indexedPath(indexedFolder); + if (indexedPath.isParentOf(url)) { isIndexed = true; break; } @@ -72,7 +71,8 @@ bool DolphinSearchInformation::isPathIndexed(const KUrl& url) const // excluded folder is part of the path. const QStringList excludedFolders = strigiConfig.group("General").readPathEntry("exclude folders", QStringList()); foreach (const QString& excludedFolder, excludedFolders) { - if (path.startsWith(excludedFolder)) { + const KUrl excludedPath(excludedFolder); + if (excludedPath.isParentOf(url)) { isIndexed = false; break; } |
