author | zecke <zecke> | 2002-03-22 16:59:27 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-03-22 16:59:27 (UTC) |
commit | da1430c6bd5fee39a19b294017848b95198217af (patch) (side-by-side diff) | |
tree | 5151db04f91339abffac1fbb69ca56673f8c3918 | |
parent | 966b7c4d3a691c59b428ffba34e6e3a0149e4698 (diff) | |
download | opie-da1430c6bd5fee39a19b294017848b95198217af.zip opie-da1430c6bd5fee39a19b294017848b95198217af.tar.gz opie-da1430c6bd5fee39a19b294017848b95198217af.tar.bz2 |
make something kewl possible
-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 @@ -478,96 +478,97 @@ void Launcher::showMaximized() void Launcher::doMaximize() { QMainWindow::showMaximized(); } void Launcher::updateMimeTypes() { MimeType::clear(); updateMimeTypes(rootFolder); } void Launcher::updateMimeTypes(AppLnkSet* folder) { for ( QListIterator<AppLnk> it( folder->children() ); it.current(); ++it ) { AppLnk *app = it.current(); if ( app->type() == "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") ); } void Launcher::nextView() { tabs->nextTab(); } void Launcher::select( const AppLnk *appLnk ) { if ( appLnk->type() == "Folder" ) { // Not supported: flat is simpler for the user } else { if ( appLnk->exec().isNull() ) { QMessageBox::information(this,tr("No application"), tr("<p>No application is defined for this document." 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 @@ -86,51 +86,53 @@ class Launcher : public QMainWindow { Q_OBJECT friend class LauncherPrivate; public: Launcher( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Launcher(); static QString appsFolderName(); virtual void showMaximized(); static bool mkdir(const QString &path); public slots: void viewSelected(const QString&); void select( const AppLnk * ); void externalSelected( const AppLnk *); 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 + |