summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 39dc7c9..63f853e 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -436,16 +436,20 @@ void DocumentListPrivate::appendDocpath(FileSystem*fs)
436 QFileInfo f(fs->path()+"/.opiestorage.cf"); 436 QFileInfo f(fs->path()+"/.opiestorage.cf");
437 if (!f.exists()) { 437 if (!f.exists()) {
438 Mediadlg dlg(fs); 438 Mediadlg dlg(fs);
439 if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) { 439 if (QDialog::Accepted != QPEApplication::execDialog( &dlg )) {
440 return; 440 return;
441 } 441 }
442 } 442 }
443 Config conf(f.filePath(), Config::File ); 443 Config conf(f.filePath(), Config::File );
444 conf.setGroup("main");
445 if (!conf.readBoolEntry("check",false)) {
446 return;
447 }
444 conf.setGroup("subdirs"); 448 conf.setGroup("subdirs");
445 bool read_all = conf.readBoolEntry("wholemedia",true); 449 bool read_all = conf.readBoolEntry("wholemedia",true);
446 if (read_all) { 450 if (read_all) {
447 docPaths+=fs->path(); 451 docPaths+=fs->path();
448 return; 452 return;
449 } 453 }
450 QStringList subDirs = conf.readListEntry("subdirs",':'); 454 QStringList subDirs = conf.readListEntry("subdirs",':');
451 if (subDirs.isEmpty()) { 455 if (subDirs.isEmpty()) {
@@ -555,16 +559,19 @@ const QString DocumentListPrivate::nextFile()
555 lists[0] = listDirs[0]->entryInfoList(); 559 lists[0] = listDirs[0]->entryInfoList();
556 listPositions[0] = 0; 560 listPositions[0] = 0;
557 searchDepth = 0; 561 searchDepth = 0;
558 } 562 }
559 } 563 }
560 } 564 }
561 565
562 const QFileInfoList *fil = lists[searchDepth]; 566 const QFileInfoList *fil = lists[searchDepth];
567 if (!fil) {
568 return QString::null;
569 }
563 QFileInfoList *fl = (QFileInfoList *)fil; 570 QFileInfoList *fl = (QFileInfoList *)fil;
564 unsigned int pos = listPositions[searchDepth]; 571 unsigned int pos = listPositions[searchDepth];
565 572
566 if ( pos >= fl->count() ) { 573 if ( pos >= fl->count() ) {
567 // go up a depth 574 // go up a depth
568 delete listDirs[searchDepth]; 575 delete listDirs[searchDepth];
569 listDirs[searchDepth] = 0; 576 listDirs[searchDepth] = 0;
570 lists[searchDepth] = 0; 577 lists[searchDepth] = 0;