Changeset View
Changeset View
Standalone View
Standalone View
src/file/fileindexerconfig.cpp
Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Line(s) | |||||
307 | } | 307 | } | ||
308 | 308 | | |||
309 | void FileIndexerConfig::buildFolderCache() | 309 | void FileIndexerConfig::buildFolderCache() | ||
310 | { | 310 | { | ||
311 | if (!m_folderCacheDirty) { | 311 | if (!m_folderCacheDirty) { | ||
312 | return; | 312 | return; | ||
313 | } | 313 | } | ||
314 | 314 | | |||
315 | if (!m_devices) { | | |||
316 | m_devices = new StorageDevices(this); | | |||
317 | } | | |||
318 | | ||||
319 | KConfigGroup group = m_config.group("General"); | 315 | KConfigGroup group = m_config.group("General"); | ||
320 | QStringList includeFoldersPlain = group.readPathEntry("folders", QStringList() << QDir::homePath()); | 316 | QStringList includeFoldersPlain = group.readPathEntry("folders", QStringList() << QDir::homePath()); | ||
321 | QStringList excludeFoldersPlain = group.readPathEntry("exclude folders", QStringList()); | 317 | QStringList excludeFoldersPlain = group.readPathEntry("exclude folders", QStringList()); | ||
322 | 318 | | |||
323 | // Add all removable media and network shares as ignored unless they have | 319 | // Add all removable media and network shares as ignored unless they have | ||
324 | // been explicitly added in the include list | 320 | // been explicitly added in the include list | ||
325 | const auto allMedia = m_devices->allMedia(); | 321 | for (const auto& device: storageDevices()->allMedia()) { | ||
326 | for (const auto& device: allMedia) { | | |||
327 | const QString mountPath = device.mountPath(); | 322 | const QString mountPath = device.mountPath(); | ||
328 | if (!device.isUsable() && !mountPath.isEmpty()) { | 323 | if (!device.isUsable() && !mountPath.isEmpty()) { | ||
329 | if (!includeFoldersPlain.contains(mountPath)) { | 324 | if (!includeFoldersPlain.contains(mountPath)) { | ||
330 | excludeFoldersPlain << mountPath; | 325 | excludeFoldersPlain << mountPath; | ||
331 | } | 326 | } | ||
332 | } | 327 | } | ||
333 | } | 328 | } | ||
334 | 329 | | |||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 386 | { | |||
392 | return m_config.group("Basic Settings").readEntry("Indexing-Enabled", true); | 387 | return m_config.group("Basic Settings").readEntry("Indexing-Enabled", true); | ||
393 | } | 388 | } | ||
394 | 389 | | |||
395 | uint FileIndexerConfig::maxUncomittedFiles() | 390 | uint FileIndexerConfig::maxUncomittedFiles() | ||
396 | { | 391 | { | ||
397 | return m_maxUncomittedFiles; | 392 | return m_maxUncomittedFiles; | ||
398 | } | 393 | } | ||
399 | 394 | | |||
395 | StorageDevices* FileIndexerConfig::storageDevices() | ||||
396 | { | ||||
397 | if (!m_devices) { | ||||
398 | m_devices = new StorageDevices(this); | ||||
399 | } | ||||
400 | | ||||
401 | return m_devices; | ||||
402 | } |