summaryrefslogtreecommitdiff
path: root/core/launcher
authorleseb <leseb>2002-08-30 19:03:23 (UTC)
committer leseb <leseb>2002-08-30 19:03:23 (UTC)
commit2922e5f8c94cf459c75c631a2ec0a4aedc570e67 (patch) (unidiff)
tree85a9e48607a4d1a1a2a3464b135ade74a2619e92 /core/launcher
parentf082457be1262b6f96ee4ebfab570f5c8200a11f (diff)
downloadopie-2922e5f8c94cf459c75c631a2ec0a4aedc570e67.zip
opie-2922e5f8c94cf459c75c631a2ec0a4aedc570e67.tar.gz
opie-2922e5f8c94cf459c75c631a2ec0a4aedc570e67.tar.bz2
View docs in RAM
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
@@ -556,6 +556,19 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
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
@@ -569,14 +582,11 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
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 );
@@ -586,7 +596,7 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
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");
@@ -827,7 +837,7 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
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() + ";";
@@ -836,7 +846,7 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
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 =