summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 02124d2..effcd24 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -547,55 +547,65 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
547 */ 547 */
548void Launcher::loadDocs() // ok here comes a hack belonging to Global:: 548void Launcher::loadDocs() // ok here comes a hack belonging to Global::
549{ 549{
550 delete docsFolder; 550 delete docsFolder;
551 docsFolder = new DocLnkSet; 551 docsFolder = new DocLnkSet;
552 552
553 DocLnkSet *tmp = 0; 553 DocLnkSet *tmp = 0;
554 QString home = QString(getenv("HOME")) + "/Documents"; 554 QString home = QString(getenv("HOME")) + "/Documents";
555 tmp = new DocLnkSet( home , QString::null); 555 tmp = new DocLnkSet( home , QString::null);
556 docsFolder->appendFrom( *tmp ); 556 docsFolder->appendFrom( *tmp );
557 delete tmp; 557 delete tmp;
558 558
559 // RAM documents
560 StorageInfo storage;
561 const QList<FileSystem> &fileSystems = storage.fileSystems();
562 QListIterator<FileSystem> it ( fileSystems );
563
564 for ( ; it.current(); ++it ) {
565 if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) {
566 tmp = new DocLnkSet( (*it)->path(), QString::null );
567 docsFolder->appendFrom( *tmp );
568 delete tmp;
569 }
570 }
571
559 Config mediumCfg( "medium"); 572 Config mediumCfg( "medium");
560 mediumCfg.setGroup("main"); 573 mediumCfg.setGroup("main");
561 // a) -zecke we don't want to check 574 // a) -zecke we don't want to check
562 if(!mediumCfg.readBoolEntry("use", true ) ) 575 if(!mediumCfg.readBoolEntry("use", true ) )
563 return; 576 return;
564 577
565 // find out wich filesystems are new in this round 578 // find out wich filesystems are new in this round
566 // We will do this by having a timestamp inside each mountpoint 579 // We will do this by having a timestamp inside each mountpoint
567 // if the current timestamp doesn't match this is a new file system and 580 // if the current timestamp doesn't match this is a new file system and
568 // come up with our MediumMountGui :) let the hacking begin 581 // come up with our MediumMountGui :) let the hacking begin
569 int stamp = uidgen.generate(); 582 int stamp = uidgen.generate();
570 583
571 QString newStamp = QString::number( stamp ); // generates newtime Stamp 584 QString newStamp = QString::number( stamp ); // generates newtime Stamp
572 StorageInfo storage;
573 const QList<FileSystem> &fileSystems = storage.fileSystems();
574 QListIterator<FileSystem> it ( fileSystems );
575 585
576 // b) 586 // b)
577 if( mediumCfg.readBoolEntry("global", true ) ){ 587 if( mediumCfg.readBoolEntry("global", true ) ){
578 QString mime = configToMime(&mediumCfg).join(";"); 588 QString mime = configToMime(&mediumCfg).join(";");
579 for( ; it.current(); ++it ){ 589 for( it.toFirst(); it.current(); ++it ){
580 if( (*it)->isRemovable() ){ 590 if( (*it)->isRemovable() ){
581 tmp = new DocLnkSet( (*it)->path(), mime ); 591 tmp = new DocLnkSet( (*it)->path(), mime );
582 docsFolder->appendFrom( *tmp ); 592 docsFolder->appendFrom( *tmp );
583 delete tmp; 593 delete tmp;
584 } 594 }
585 } // done 595 } // done
586 return; // save the else 596 return; // save the else
587 } 597 }
588 // c) zecke 598 // c) zecke
589 for ( ; it.current(); ++it ) { 599 for ( it.toFirst(); it.current(); ++it ) {
590 if ( (*it)->isRemovable() ) { // let's find out if we should search on it 600 if ( (*it)->isRemovable() ) { // let's find out if we should search on it
591 Config cfg( (*it)->path() + "/.opiestorage.cf", Config::File); 601 Config cfg( (*it)->path() + "/.opiestorage.cf", Config::File);
592 cfg.setGroup("main"); 602 cfg.setGroup("main");
593 QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); 603 QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
594 /** This medium is uptodate 604 /** This medium is uptodate
595 */ 605 */
596 if( stamp == m_timeStamp ){ // ok we know this card 606 if( stamp == m_timeStamp ){ // ok we know this card
597 cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp 607 cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp
598 // we need to scan the list now. Hopefully the cache will be there 608 // we need to scan the list now. Hopefully the cache will be there
599 // read the mimetypes from the config and search for documents 609 // read the mimetypes from the config and search for documents
600 QStringList mimetypes = configToMime( &cfg); 610 QStringList mimetypes = configToMime( &cfg);
601 tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") ); 611 tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") );
@@ -818,34 +828,34 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
818 cfg.writeEntry("Delay", delay); 828 cfg.writeEntry("Delay", delay);
819 } 829 }
820 } else { 830 } else {
821 } 831 }
822 } else if ( msg == "sendCardInfo()" ) { 832 } else if ( msg == "sendCardInfo()" ) {
823 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); 833 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
824 const QList<FileSystem> &fs = storage->fileSystems(); 834 const QList<FileSystem> &fs = storage->fileSystems();
825 QListIterator<FileSystem> it ( fs ); 835 QListIterator<FileSystem> it ( fs );
826 QString s; 836 QString s;
827 QString homeDir = getenv("HOME"); 837 QString homeDir = getenv("HOME");
828 QString hardDiskHome; 838 QString hardDiskHome;
829 for ( ; it.current(); ++it ) { 839 for ( ; it.current(); ++it ) {
830 if ( (*it)->isRemovable() ) 840 if ( (*it)->isRemovable() || (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" )
831 s += (*it)->name() + "=" + (*it)->path() + "/Documents " 841 s += (*it)->name() + "=" + (*it)->path() + "/Documents "
832 + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) 842 + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
833 + " " + (*it)->options() + ";"; 843 + " " + (*it)->options() + ";";
834 else if ( (*it)->disk() == "/dev/mtdblock1" || 844 else if ( (*it)->disk() == "/dev/mtdblock1" ||
835 (*it)->disk() == "/dev/mtdblock/1" ) 845 (*it)->disk() == "/dev/mtdblock/1" )
836 s += (*it)->name() + "=" + homeDir + "/Documents " 846 s += (*it)->name() + "=" + homeDir + "/Documents "
837 + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) 847 + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
838 + " " + (*it)->options() + ";"; 848 + " " + (*it)->options() + ";";
839 else if ( (*it)->name().contains( "Hard Disk") && 849 else if ( (*it)->name().contains( tr("Hard Disk") ) &&
840 homeDir.contains( (*it)->path() ) && 850 homeDir.contains( (*it)->path() ) &&
841 (*it)->path().length() > hardDiskHome.length() ) 851 (*it)->path().length() > hardDiskHome.length() )
842 hardDiskHome = 852 hardDiskHome =
843 (*it)->name() + "=" + homeDir + "/Documents " 853 (*it)->name() + "=" + homeDir + "/Documents "
844 + QString::number( (*it)->availBlocks() * (*it)->blockSize() ) 854 + QString::number( (*it)->availBlocks() * (*it)->blockSize() )
845 + " " + (*it)->options() + ";"; 855 + " " + (*it)->options() + ";";
846 } 856 }
847 if ( !hardDiskHome.isEmpty() ) 857 if ( !hardDiskHome.isEmpty() )
848 s += hardDiskHome; 858 s += hardDiskHome;
849 859
850 e << s; 860 e << s;
851 } else if ( msg == "sendSyncDate(QString)" ) { 861 } else if ( msg == "sendSyncDate(QString)" ) {