Fix the problem that filelight always scan across filesystem boundary

The solid's filePath doesn't contain a trailing '/'.  This will cause
the comparision

if (new_path == (*it)->name8Bit())

to be false so that filelight always scans across filesystem boundary.

Patch by Yichao Zhou.

REVIEW: 120707
parent 8f13567a
......@@ -241,13 +241,16 @@ void LocalLister::readMounts()
partition = device.as<Solid::StorageAccess>();
if (!partition->isAccessible() || partition->filePath() == QLatin1String( "/" ) || partition->filePath().isEmpty()) continue;
QString filePath = partition->filePath();
if (!filePath.endsWith(QLatin1String("/")))
filePath.append(QLatin1String("/"));
volume = device.as<Solid::StorageVolume>();
if (remoteFsTypes.contains(volume->fsType())) {
if (!s_remoteMounts.contains(partition->filePath())) {
s_remoteMounts.append(partition->filePath());
if (!s_remoteMounts.contains(filePath)) {
s_remoteMounts.append(filePath);
}
} else if (!s_localMounts.contains(partition->filePath())) {
s_localMounts.append(partition->filePath());
} else if (!s_localMounts.contains(filePath)) {
s_localMounts.append(filePath);
}
}
......
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