summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp41
1 files changed, 35 insertions, 6 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
@@ -65,2 +65,4 @@ public:
void estimatedPercentScanned();
+ void appendDocpath(FileSystem*);
+
@@ -429,2 +431,28 @@ DocumentListPrivate::DocumentListPrivate( ServerInterface *gui )
+void DocumentListPrivate::appendDocpath(FileSystem*fs)
+{
+ QDir defPath(fs->path()+"/Documents");
+ QFileInfo f(fs->path()+"/.opiestorage.cf");
+ if (!f.exists()) {
+ if (defPath.exists()) {
+ docPaths+=defPath.path();
+ }
+ return;
+ }
+ Config conf(f.filePath(), Config::File );
+ conf.setGroup("subdirs");
+ QStringList subDirs = conf.readListEntry("subdirs",':');
+ if (subDirs.isEmpty()) {
+ if (defPath.exists()) {
+ docPaths+=defPath.path();
+ }
+ return;
+ }
+ for (unsigned c = 0; c < subDirs.count();++c) {
+ QDir docDir(QString(fs->path()+"/"+subDirs[c]));
+ if (docDir.exists()) {
+ docPaths+=docDir.path();
+ }
+ }
+}
@@ -443,9 +471,10 @@ void DocumentListPrivate::initialize()
QListIterator<FileSystem> it( fs );
- for ( ; it.current(); ++it )
- if ( (*it)->isRemovable() ) {
- docPaths += (*it)->path();
- i++;
- }
+ for ( ; it.current(); ++it ) {
+ if ( (*it)->isRemovable() ) {
+ appendDocpath((*it));
+ ++i;
+ }
+ }
- for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) {
+ for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) {
if ( listDirs[i] ) {