summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp39
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 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (c) 2002 Holger zecke Freyther
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
@@ -24,2 +25,3 @@
24 25
26#include <opie/oconfig.h>
25#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
@@ -34,2 +36,3 @@
34 36
37#include <qdatetime.h>
35#include <qdir.h> 38#include <qdir.h>
@@ -68,2 +71,4 @@
68 71
72#include <qpe/storage.h>
73#include "mediummountgui.h"
69//#define SHOW_ALL 74//#define SHOW_ALL
@@ -419,2 +424,3 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
419 docsFolder = 0; 424 docsFolder = 0;
425 m_timeStamp = QDateTime::currentDateTime().toString();
420 426
@@ -494,3 +500,3 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
494 500
495void Launcher::loadDocs() 501void Launcher::loadDocs() // ok here comes a hack belonging to Global::
496{ 502{
@@ -498,3 +504,32 @@ void Launcher::loadDocs()
498 docsFolder = new DocLnkSet; 504 docsFolder = new DocLnkSet;
499 Global::findDocuments(docsFolder); 505 // find out wich filesystems are new in this round
506 // We will do this by having a timestamp inside each mountpoint
507 // if the current timestamp doesn't match this is a new file system and
508 // come up with our MediumMountGui :) let the hacking begin
509 QString newStamp = QDateTime::currentDateTime().toString();
510 StorageInfo storage;
511 const QList<FileSystem> &fileSystems = storage.fileSystems();
512 QListIterator<FileSystem> it ( fileSystems );
513 for ( ; it.current(); ++it ) {
514 if ( (*it)->isRemovable() ) { // let's find out if we should search on it
515 OConfig cfg( (*it)->path() + "/.opiestorage.cf");
516 cfg.setGroup("main");
517 QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
518 if( stamp == m_timeStamp ){ // ok we know this card
519 cfg.writeEntry("timestamp", newStamp );
520 // we need to scan the list now. Hopefully the cache will be there
521 }else{ // come up with the gui
522 MediumMountGui medium((*it)->path() + "/.opiestorage.cf" );
523 if( medium.check() ){
524 if( medium.exec() ){ //ok
525 // speicher
526 }
527 }else{
528 // do something different see what we need to do
529 }
530 }
531 }
532 }
533 Global::findDocuments(docsFolder); // get rid of this call later
534 m_timeStamp = newStamp;
500} 535}