X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/7045a25e3abaedab0d128f03702eaf48ffe6e0b7..509464cce954f7fc4b00a9dafc2bc6355eb99ec6:/src/search/dolphinsearchinformation.cpp diff --git a/src/search/dolphinsearchinformation.cpp b/src/search/dolphinsearchinformation.cpp index 2cba5a147..8af951a7b 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; } @@ -81,7 +81,7 @@ bool DolphinSearchInformation::isPathIndexed(const KUrl& url) const return isIndexed; #else - Q_UNUSED(path); + Q_UNUSED(url); return false; #endif } @@ -90,9 +90,9 @@ DolphinSearchInformation::DolphinSearchInformation() : m_indexingEnabled(false) { #ifdef HAVE_NEPOMUK - if (Nepomuk::ResourceManager::instance()->init() == 0) { + if (Nepomuk::ResourceManager::instance()->initialized()) { KConfig config("nepomukserverrc"); - m_indexingEnabled = config.group("Service-nepomukstrigiservice").readEntry("autostart", false); + m_indexingEnabled = config.group("Service-nepomukfileindexer").readEntry("autostart", false); } #endif }