Changeset View
Changeset View
Standalone View
Standalone View
src/file/fileindexerconfig.cpp
Show First 20 Lines • Show All 245 Lines • ▼ Show 20 Line(s) | 244 | if (p.startsWith(f)) { | |||
---|---|---|---|---|---|
246 | return include; | 246 | return include; | ||
247 | } | 247 | } | ||
248 | } | 248 | } | ||
249 | // path is not in the list, thus it should not be included | 249 | // path is not in the list, thus it should not be included | ||
250 | folder.clear(); | 250 | folder.clear(); | ||
251 | return false; | 251 | return false; | ||
252 | } | 252 | } | ||
253 | 253 | | |||
254 | bool FileIndexerConfig::pathDeviceIsMounted(const QString& path) | ||||
255 | { | ||||
256 | if (!m_devices) { | ||||
257 | m_devices = new StorageDevices(this); | ||||
258 | } | ||||
259 | | ||||
260 | for (const auto& device: m_devices->allMedia()) { | ||||
261 | const QString devicePath = device.mountPath() + QLatin1Char('/'); | ||||
262 | if (device.isMounted() && path.startsWith(devicePath)) { | ||||
263 | return true; | ||||
264 | } | ||||
265 | } | ||||
266 | | ||||
267 | return false; | ||||
268 | } | ||||
254 | 269 | | |||
255 | namespace | 270 | namespace | ||
256 | { | 271 | { | ||
257 | /** | 272 | /** | ||
258 | * Returns true if the specified folder f would already be excluded using the list | 273 | * Returns true if the specified folder f would already be excluded using the list | ||
259 | * folders. | 274 | * folders. | ||
260 | */ | 275 | */ | ||
261 | bool alreadyExcluded(const QList<QPair<QString, bool> >& folders, const QString& f) | 276 | bool alreadyExcluded(const QList<QPair<QString, bool> >& folders, const QString& f) | ||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |