-rw-r--r-- | core/launcher/launcher.cpp | 1 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 222592b..b26bd8b 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -494,64 +494,65 @@ void Launcher::updateMimeTypes(AppLnkSet* folder) updateMimeTypes((AppLnkSet *)app); else { MimeType::registerApp(*app); } } } void Launcher::loadDocs() // ok here comes a hack belonging to Global:: { delete docsFolder; docsFolder = 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(); 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 + cfg.writeEntry("timestamp", newStamp ); } }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() { MimeType::updateApplications(); // ### reads all applnks twice delete rootFolder; rootFolder = new AppLnkSet( MimeType::appsFolderName() ); loadDocs(); tabs->initializeCategories(rootFolder, docsFolder, storage->fileSystems()); } void Launcher::updateDocs() { loadDocs(); tabs->updateDocs(docsFolder,storage->fileSystems()); } void Launcher::viewSelected(const QString& s) { setCaption( s + tr(" - Launcher") ); diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index 00ae980..197bd19 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h @@ -102,35 +102,37 @@ public slots: void properties( AppLnk * ); void nextView(); signals: void executing( const AppLnk * ); void busy(); void notBusy(const QString&); private slots: void doMaximize(); void systemMessage( const QCString &, const QByteArray &); void storageChanged(); void cancelSync(); private: void updateApps(); void loadDocs(); void updateDocs(); void updateTabs(); void updateMimeTypes(); void updateMimeTypes(AppLnkSet*); void preloadApps(); AppLnkSet *rootFolder; DocLnkSet *docsFolder; CategoryTabWidget *tabs; StorageInfo *storage; SyncDialog *syncDialog; void updateLink(const QString& link); bool in_lnk_props; bool got_lnk_change; QString lnk_change; + QString m_timeStamp; }; #endif // LAUNCHERVIEW_H + |