summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-22 20:06:29 (UTC)
committer alwin <alwin>2004-02-22 20:06:29 (UTC)
commit63e45b90437e78ee11753c6782516dc38c30dd24 (patch) (unidiff)
treeb9a700b759ef5ee03c04f2df0e59e43c5a0bfa50
parent5738a3d33bdaeb69994f70fd5ec8aa49df98ceeb (diff)
downloadopie-63e45b90437e78ee11753c6782516dc38c30dd24.zip
opie-63e45b90437e78ee11753c6782516dc38c30dd24.tar.gz
opie-63e45b90437e78ee11753c6782516dc38c30dd24.tar.bz2
read more settings from opiestorage.cf
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index fdba687..9736e65 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -380,128 +380,133 @@ void DocumentList::sendAllDocLinks()
380#ifndef QT_NO_COP 380#ifndef QT_NO_COP
381 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); 381 QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
382 e << contents; 382 e << contents;
383#endif 383#endif
384 //qDebug( "================ \n\n%s\n\n===============", contents.latin1() ); 384 //qDebug( "================ \n\n%s\n\n===============", contents.latin1() );
385 385
386 d->needToSendAllDocLinks = false; 386 d->needToSendAllDocLinks = false;
387} 387}
388 388
389 389
390 390
391 391
392 392
393 393
394 394
395 395
396 396
397 397
398 398
399 399
400 400
401 401
402 402
403 403
404 404
405 405
406 406
407 407
408 408
409 409
410 410
411 411
412DocumentListPrivate::DocumentListPrivate( ServerInterface *gui ) 412DocumentListPrivate::DocumentListPrivate( ServerInterface *gui )
413{ 413{
414 storage = new StorageInfo( this ); 414 storage = new StorageInfo( this );
415 serverGui = gui; 415 serverGui = gui;
416 if ( serverGui ) { 416 if ( serverGui ) {
417 sendAppLnks = serverGui->requiresApplications(); 417 sendAppLnks = serverGui->requiresApplications();
418 sendDocLnks = serverGui->requiresDocuments(); 418 sendDocLnks = serverGui->requiresDocuments();
419 } else { 419 } else {
420 sendAppLnks = false; 420 sendAppLnks = false;
421 sendDocLnks = false; 421 sendDocLnks = false;
422 } 422 }
423 for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) { 423 for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) {
424 listDirs[i] = 0; 424 listDirs[i] = 0;
425 lists[i] = 0; 425 lists[i] = 0;
426 listPositions[i] = 0; 426 listPositions[i] = 0;
427 } 427 }
428 initialize(); 428 initialize();
429 tid = 0; 429 tid = 0;
430} 430}
431 431
432void DocumentListPrivate::appendDocpath(FileSystem*fs) 432void DocumentListPrivate::appendDocpath(FileSystem*fs)
433{ 433{
434 QDir defPath(fs->path()+"/Documents"); 434 QDir defPath(fs->path()+"/Documents");
435 QFileInfo f(fs->path()+"/.opiestorage.cf"); 435 QFileInfo f(fs->path()+"/.opiestorage.cf");
436 if (!f.exists()) { 436 if (!f.exists()) {
437 if (defPath.exists()) { 437 if (defPath.exists()) {
438 docPaths+=defPath.path(); 438 docPaths+=defPath.path();
439 } 439 }
440 return; 440 return;
441 } 441 }
442 Config conf(f.filePath(), Config::File ); 442 Config conf(f.filePath(), Config::File );
443 conf.setGroup("subdirs"); 443 conf.setGroup("subdirs");
444 bool read_all = conf.readBoolEntry("wholemedia",true);
445 if (read_all) {
446 docPaths+=fs->path();
447 return;
448 }
444 QStringList subDirs = conf.readListEntry("subdirs",':'); 449 QStringList subDirs = conf.readListEntry("subdirs",':');
445 if (subDirs.isEmpty()) { 450 if (subDirs.isEmpty()) {
446 if (defPath.exists()) { 451 if (defPath.exists()) {
447 docPaths+=defPath.path(); 452 docPaths+=defPath.path();
448 } 453 }
449 return; 454 return;
450 } 455 }
451 for (unsigned c = 0; c < subDirs.count();++c) { 456 for (unsigned c = 0; c < subDirs.count();++c) {
452 QDir docDir(QString(fs->path()+"/"+subDirs[c])); 457 QDir docDir(QString(fs->path()+"/"+subDirs[c]));
453 if (docDir.exists()) { 458 if (docDir.exists()) {
454 docPaths+=docDir.path(); 459 docPaths+=docDir.path();
455 } 460 }
456 } 461 }
457} 462}
458 463
459void DocumentListPrivate::initialize() 464void DocumentListPrivate::initialize()
460{ 465{
461 // Reset 466 // Reset
462 dls.clear(); 467 dls.clear();
463 docPaths.clear(); 468 docPaths.clear();
464 reference.clear(); 469 reference.clear();
465 470
466 QDir docDir( QPEApplication::documentDir() ); 471 QDir docDir( QPEApplication::documentDir() );
467 if ( docDir.exists() ) 472 if ( docDir.exists() )
468 docPaths += QPEApplication::documentDir(); 473 docPaths += QPEApplication::documentDir();
469 int i = 1; 474 int i = 1;
470 const QList<FileSystem> &fs = storage->fileSystems(); 475 const QList<FileSystem> &fs = storage->fileSystems();
471 QListIterator<FileSystem> it( fs ); 476 QListIterator<FileSystem> it( fs );
472 for ( ; it.current(); ++it ) { 477 for ( ; it.current(); ++it ) {
473 if ( (*it)->isRemovable() ) { 478 if ( (*it)->isRemovable() ) {
474 appendDocpath((*it)); 479 appendDocpath((*it));
475 ++i; 480 ++i;
476 } 481 }
477 } 482 }
478 483
479 for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) { 484 for ( int i = 0; i < MAX_SEARCH_DEPTH; ++i ) {
480 if ( listDirs[i] ) { 485 if ( listDirs[i] ) {
481 delete listDirs[i]; 486 delete listDirs[i];
482 listDirs[i] = 0; 487 listDirs[i] = 0;
483 } 488 }
484 lists[i] = 0; 489 lists[i] = 0;
485 listPositions[i] = 0; 490 listPositions[i] = 0;
486 } 491 }
487 492
488 docPathsSearched = 0; 493 docPathsSearched = 0;
489 searchDepth = -1; 494 searchDepth = -1;
490 state = Find; 495 state = Find;
491 dit = 0; 496 dit = 0;
492} 497}
493 498
494 499
495DocumentListPrivate::~DocumentListPrivate() 500DocumentListPrivate::~DocumentListPrivate()
496{ 501{
497 for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) 502 for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ )
498 if ( listDirs[i] ) 503 if ( listDirs[i] )
499 delete listDirs[i]; 504 delete listDirs[i];
500 delete dit; 505 delete dit;
501} 506}
502 507
503 508
504void DocumentListPrivate::estimatedPercentScanned() 509void DocumentListPrivate::estimatedPercentScanned()
505{ 510{
506 double overallProgress = 0.0; 511 double overallProgress = 0.0;
507 double levelWeight = 75.0; 512 double levelWeight = 75.0;