summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -551,47 +551,57 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
docsFolder = new DocLnkSet;
DocLnkSet *tmp = 0;
QString home = QString(getenv("HOME")) + "/Documents";
tmp = new DocLnkSet( home , QString::null);
docsFolder->appendFrom( *tmp );
delete tmp;
+ // RAM documents
+ StorageInfo storage;
+ const QList<FileSystem> &fileSystems = storage.fileSystems();
+ QListIterator<FileSystem> it ( fileSystems );
+
+ for ( ; it.current(); ++it ) {
+ if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) {
+ tmp = new DocLnkSet( (*it)->path(), QString::null );
+ docsFolder->appendFrom( *tmp );
+ delete tmp;
+ }
+ }
+
Config mediumCfg( "medium");
mediumCfg.setGroup("main");
// a) -zecke we don't want to check
if(!mediumCfg.readBoolEntry("use", true ) )
return;
// find out wich filesystems are new in this round
// We will do this by having a timestamp inside each mountpoint
// if the current timestamp doesn't match this is a new file system and
// come up with our MediumMountGui :) let the hacking begin
int stamp = uidgen.generate();
QString newStamp = QString::number( stamp ); // generates newtime Stamp
- StorageInfo storage;
- const QList<FileSystem> &fileSystems = storage.fileSystems();
- QListIterator<FileSystem> it ( fileSystems );
// b)
if( mediumCfg.readBoolEntry("global", true ) ){
QString mime = configToMime(&mediumCfg).join(";");
- for( ; it.current(); ++it ){
+ for( it.toFirst(); it.current(); ++it ){
if( (*it)->isRemovable() ){
tmp = new DocLnkSet( (*it)->path(), mime );
docsFolder->appendFrom( *tmp );
delete tmp;
}
} // done
return; // save the else
}
// c) zecke
- for ( ; it.current(); ++it ) {
+ for ( it.toFirst(); it.current(); ++it ) {
if ( (*it)->isRemovable() ) { // let's find out if we should search on it
Config cfg( (*it)->path() + "/.opiestorage.cf", Config::File);
cfg.setGroup("main");
QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
/** This medium is uptodate
*/
if( stamp == m_timeStamp ){ // ok we know this card
cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp
@@ -822,26 +832,26 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
} else if ( msg == "sendCardInfo()" ) {
QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
const QList<FileSystem> &fs = storage->fileSystems();
QListIterator<FileSystem> it ( fs );
QString s;
QString homeDir = getenv("HOME");
QString hardDiskHome;
for ( ; it.current(); ++it ) {
- if ( (*it)->isRemovable() )
+ if ( (*it)->isRemovable() || (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" )
s += (*it)->name() + "=" + (*it)->path() + "/Documents "
+ QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ " " + (*it)->options() + ";";
else if ( (*it)->disk() == "/dev/mtdblock1" ||
(*it)->disk() == "/dev/mtdblock/1" )
s += (*it)->name() + "=" + homeDir + "/Documents "
+ QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ " " + (*it)->options() + ";";
- else if ( (*it)->name().contains( "Hard Disk") &&
+ else if ( (*it)->name().contains( tr("Hard Disk") ) &&
homeDir.contains( (*it)->path() ) &&
(*it)->path().length() > hardDiskHome.length() )
hardDiskHome =
(*it)->name() + "=" + homeDir + "/Documents "
+ QString::number( (*it)->availBlocks() * (*it)->blockSize() )
+ " " + (*it)->options() + ";";
}
if ( !hardDiskHome.isEmpty() )