Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 440bf1e..fdba687 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp | |||
@@ -64,4 +64,6 @@ public: | |||
64 | bool store( DocLnk* dl ); | 64 | bool store( DocLnk* dl ); |
65 | void estimatedPercentScanned(); | 65 | void estimatedPercentScanned(); |
66 | void appendDocpath(FileSystem*); | ||
67 | |||
66 | 68 | ||
67 | DocLnkSet dls; | 69 | DocLnkSet dls; |
@@ -428,4 +430,30 @@ DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) | |||
428 | } | 430 | } |
429 | 431 | ||
432 | void DocumentListPrivate::appendDocpath(FileSystem*fs) | ||
433 | { | ||
434 | QDir defPath(fs->path()+"/Documents"); | ||
435 | QFileInfo f(fs->path()+"/.opiestorage.cf"); | ||
436 | if (!f.exists()) { | ||
437 | if (defPath.exists()) { | ||
438 | docPaths+=defPath.path(); | ||
439 | } | ||
440 | return; | ||
441 | } | ||
442 | Config conf(f.filePath(), Config::File ); | ||
443 | conf.setGroup("subdirs"); | ||
444 | QStringList subDirs = conf.readListEntry("subdirs",':'); | ||
445 | if (subDirs.isEmpty()) { | ||
446 | if (defPath.exists()) { | ||
447 | docPaths+=defPath.path(); | ||
448 | } | ||
449 | return; | ||
450 | } | ||
451 | for (unsigned c = 0; c < subDirs.count();++c) { | ||
452 | QDir docDir(QString(fs->path()+"/"+subDirs[c])); | ||
453 | if (docDir.exists()) { | ||
454 | docPaths+=docDir.path(); | ||
455 | } | ||
456 | } | ||
457 | } | ||
430 | 458 | ||
431 | void DocumentListPrivate::initialize() | 459 | void DocumentListPrivate::initialize() |
@@ -442,11 +470,12 @@ void DocumentListPrivate::initialize() | |||
442 | const QList<FileSystem> &fs = storage->fileSystems(); | 470 | const QList<FileSystem> &fs = storage->fileSystems(); |
443 | QListIterator<FileSystem> it( fs ); | 471 | QListIterator<FileSystem> it( fs ); |
444 | for ( ; it.current(); ++it ) | 472 | for ( ; it.current(); ++it ) { |
445 | if ( (*it)->isRemovable() ) { | 473 | if ( (*it)->isRemovable() ) { |
446 | docPaths += (*it)->path(); | 474 | appendDocpath((*it)); |
447 | i++; | 475 | ++i; |
476 | } | ||
448 | } | 477 | } |
449 | 478 | ||
450 | for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { | 479 | for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) { |
451 | if ( listDirs[i] ) { | 480 | if ( listDirs[i] ) { |
452 | delete listDirs[i]; | 481 | delete listDirs[i]; |