From 966b7c4d3a691c59b428ffba34e6e3a0149e4698 Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 22 Mar 2002 16:59:27 +0000 Subject: make something kewl possible --- 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,4 +1,5 @@ /********************************************************************** +** Copyright (c) 2002 Holger zecke Freyther ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. @@ -22,6 +23,7 @@ // have this class. #define QTOPIA_INTERNAL_FSLP +#include #include #include #include @@ -32,6 +34,7 @@ #include #include +#include #include #include #include @@ -66,6 +69,8 @@ #include #endif +#include +#include "mediummountgui.h" //#define SHOW_ALL CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : @@ -417,6 +422,7 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) tabs = 0; rootFolder = 0; docsFolder = 0; + m_timeStamp = QDateTime::currentDateTime().toString(); tabs = new CategoryTabWidget( this ); tabs->setMaximumWidth( qApp->desktop()->width() ); @@ -492,11 +498,40 @@ void Launcher::updateMimeTypes(AppLnkSet* folder) } } -void Launcher::loadDocs() +void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { delete docsFolder; 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 &fileSystems = storage.fileSystems(); + QListIterator 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; } void Launcher::updateTabs() -- cgit v0.9.0.2