-rw-r--r-- | core/launcher/launcher.cpp | 31 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 | ||||
-rw-r--r-- | core/launcher/mediummountgui.cpp | 4 |
3 files changed, 32 insertions, 5 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index b26bd8b..dcc3ba1 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -68,16 +68,20 @@ #include <sys/vfs.h> #include <mntent.h> #endif #include <qpe/storage.h> #include "mediummountgui.h" //#define SHOW_ALL +// uidGen + +// uidGen + CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : QVBox( parent ) { categoryBar = 0; stack = 0; } void CategoryTabWidget::prevTab() @@ -417,17 +421,19 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) syncDialog = 0; // we have a pretty good idea how big we'll be setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); tabs = 0; rootFolder = 0; docsFolder = 0; - m_timeStamp = QDateTime::currentDateTime().toString(); + int stamp = uidgen.generate(); + uidgen.store( stamp ); + m_timeStamp = QString::number( stamp ); tabs = new CategoryTabWidget( this ); tabs->setMaximumWidth( qApp->desktop()->width() ); setCentralWidget( tabs ); connect( tabs, SIGNAL(selected(const QString&)), this, SLOT(viewSelected(const QString&)) ); connect( tabs, SIGNAL(clicked(const AppLnk*)), @@ -495,48 +501,67 @@ void Launcher::updateMimeTypes(AppLnkSet* folder) else { MimeType::registerApp(*app); } } } void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { + qWarning("loading Documents" ); + qWarning("The currentTimeStamp is: %s", m_timeStamp.latin1() ); delete docsFolder; docsFolder = new DocLnkSet; + qWarning("new DocLnkSet" ); // 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(); + int stamp = uidgen.generate(); + + QString newStamp = QString::number( stamp ); + qWarning("new time stamp is: %s", newStamp.latin1() ); StorageInfo storage; const QList<FileSystem> &fileSystems = storage.fileSystems(); + qWarning("QList<FileSystem>" ); QListIterator<FileSystem> it ( fileSystems ); + qWarning("iterator initiliazed" ); for ( ; it.current(); ++it ) { + qWarning("inside for loop" ); + qWarning("checking device %s", (*it)->path().latin1() ); if ( (*it)->isRemovable() ) { // let's find out if we should search on it + qWarning("%s is removeable", (*it)->path().latin1() ); 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 + qWarning("time stamp match" ); 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" ); + qWarning("time stamp doesn't match" ); + MediumMountGui medium((*it)->path() ); + qWarning("medium mount gui created" ); if( medium.check() ){ + qWarning("need to check this device" ); if( medium.exec() ){ //ok // speicher + qWarning("execed" ); cfg.writeEntry("timestamp", newStamp ); } }else{ + qWarning("wrong :(" ); // do something different see what we need to do } } } } + qWarning("findDocuments" ); Global::findDocuments(docsFolder); // get rid of this call later + qWarning("done" ); m_timeStamp = newStamp; } void Launcher::updateTabs() { MimeType::updateApplications(); // ### reads all applnks twice delete rootFolder; diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index 197bd19..d2efa58 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h @@ -20,16 +20,17 @@ #ifndef LAUNCHER_H #define LAUNCHER_H #include <qmainwindow.h> #include <qtabbar.h> #include <qstringlist.h> #include <qvbox.h> #include <qlist.h> +#include <qpe/palmtopuidgen.h> #include "launcherview.h" class AppLnk; class AppLnkSet; class DocLnkSet; class QWidgetStack; class StorageInfo; class SyncDialog; @@ -127,12 +128,13 @@ private: StorageInfo *storage; SyncDialog *syncDialog; void updateLink(const QString& link); bool in_lnk_props; bool got_lnk_change; QString lnk_change; QString m_timeStamp; + Qtopia::UidGen uidgen; }; #endif // LAUNCHERVIEW_H diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp index f193024..6ad97e1 100644 --- a/core/launcher/mediummountgui.cpp +++ b/core/launcher/mediummountgui.cpp @@ -16,17 +16,17 @@ #include <qpe/resource.h> #include <opie/oconfig.h> #include <qapplication.h> MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) - : QDialog( parent, name, modal, fl ) { + : QDialog( parent, name, true ) { QWidget *d = QApplication::desktop(); int w=d->width(); int h=d->height(); resize( w , h ); setCaption( tr( "Medium inserted" ) ); @@ -34,17 +34,17 @@ MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const cha readConfig(); startGui(); } void MediumMountGui::readConfig(){ OConfig cfg (mediumPath +"/.opiestorage.cf"); cfg.setGroup("main"); - checkagain = cfg.readBoolEntry("check", false); + checkagain = cfg.readBoolEntry("check", true); cfg.setGroup("mimetypes"); checkmimeaudio = cfg.readBoolEntry("audio", true); checkmimeimage = cfg.readBoolEntry("image", true); checkmimetext = cfg.readBoolEntry("text", true); checkmimevideo = cfg.readBoolEntry("video", true); checkmimeall = cfg.readBoolEntry("all", true); |