-rw-r--r-- | core/launcher/launcher.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 8fe41f7..222592b 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -1,2 +1,3 @@ /********************************************************************** +** Copyright (c) 2002 Holger zecke Freyther ** Copyright (C) 2000 Trolltech AS. All rights reserved. @@ -24,2 +25,3 @@ +#include <opie/oconfig.h> #include <qpe/qcopenvelope_qws.h> @@ -34,2 +36,3 @@ +#include <qdatetime.h> #include <qdir.h> @@ -68,2 +71,4 @@ +#include <qpe/storage.h> +#include "mediummountgui.h" //#define SHOW_ALL @@ -419,2 +424,3 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) docsFolder = 0; + m_timeStamp = QDateTime::currentDateTime().toString(); @@ -494,3 +500,3 @@ void Launcher::updateMimeTypes(AppLnkSet* folder) -void Launcher::loadDocs() +void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { @@ -498,3 +504,32 @@ void Launcher::loadDocs() docsFolder = new DocLnkSet; - Global::findDocuments(docsFolder); + // 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 + QString newStamp = QDateTime::currentDateTime().toString(); + StorageInfo storage; + const QList<FileSystem> &fileSystems = storage.fileSystems(); + QListIterator<FileSystem> it ( fileSystems ); + for ( ; it.current(); ++it ) { + if ( (*it)->isRemovable() ) { // let's find out if we should search on it + OConfig cfg( (*it)->path() + "/.opiestorage.cf"); + cfg.setGroup("main"); + QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); + if( stamp == m_timeStamp ){ // ok we know this card + cfg.writeEntry("timestamp", newStamp ); + // we need to scan the list now. Hopefully the cache will be there + }else{ // come up with the gui + MediumMountGui medium((*it)->path() + "/.opiestorage.cf" ); + if( medium.check() ){ + if( medium.exec() ){ //ok + // speicher + } + }else{ + // do something different see what we need to do + } + } + } + } + Global::findDocuments(docsFolder); // get rid of this call later + m_timeStamp = newStamp; } |