Commit 68753ca5 authored by Matthieu Gallien's avatar Matthieu Gallien

properly detect if all paths can be handled by baloo

parent 8f3e49a8
......@@ -123,7 +123,30 @@ void LocalBalooFileListing::applicationAboutToQuit()
bool LocalBalooFileListing::canHandleRootPaths() const
{
return false;
Baloo::IndexerConfig balooConfiguration;
auto balooIncludedFolders = balooConfiguration.includeFolders();
for (const auto &onePath : allRootPaths()) {
auto onePathInfo = QFileInfo{onePath};
auto onePathCanonicalPath = onePathInfo.canonicalFilePath();
auto includedPath = false;
for (const auto &balooIncludedPath : balooIncludedFolders) {
auto balooIncludedPathInfo = QFileInfo{balooIncludedPath};
auto balooIncludedCanonicalPath = balooIncludedPathInfo.canonicalFilePath();
if (onePathCanonicalPath.startsWith(balooIncludedCanonicalPath)) {
includedPath = true;
break;
}
}
if (!includedPath) {
return false;
}
}
return true;
}
void LocalBalooFileListing::newBalooFile(const QString &fileName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment