From eb813af4c1e301c8ba015627a1da04f8199a3be2 Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 24 Mar 2002 19:31:32 +0000 Subject: Here is the second chunk of bits to make things a bit more fast --- diff --git a/library/global.cpp b/library/global.cpp index dd15eb7..5a28595 100644 --- a/library/global.cpp +++ b/library/global.cpp @@ -48,6 +48,28 @@ #include // for qwsServer #include +#include + +namespace { + // checks if the storage should be searched + bool checkStorage(const QString &path ){ // this is a small Config replacement cause config is too limited -zecke + QFile file(path ); + if(!file.open(IO_ReadOnly ) ) + return true; + + QByteArray array = file.readAll(); + QStringList list = QStringList::split('\n', QString( array ) ); + for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ + if( (*it).startsWith("autocheck = 0" ) ){ + return true; + }else if( (*it).startsWith("autocheck = 1" ) ){ + return false; + } + } + return true; + } +} + //#include "quickexec_p.h" class Emitter : public QObject { @@ -638,11 +660,14 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) const QList &fs = storage.fileSystems(); QListIterator it ( fs ); for ( ; it.current(); ++it ) { - if ( (*it)->isRemovable() ) { - QString path = (*it)->path(); - DocLnkSet ide( path, mimefilter ); - folder->appendFrom(ide); - } + if ( (*it)->isRemovable() ) { // let's find out if we should search on it + // this is a candidate look at the cf and see if we should search on it + QString path = (*it)->path(); + if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) ) + continue; + DocLnkSet ide( path, mimefilter ); + folder->appendFrom(ide); + } } } diff --git a/library/global.h b/library/global.h index d9ff8f8..fdf8754 100644 --- a/library/global.h +++ b/library/global.h @@ -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. @@ -45,6 +46,8 @@ public: static void createDocDir(); static void findDocuments(DocLnkSet* folder, const QString &mimefilter=QString::null); + // we don't need a mimefilter. Same as above but this is fast as light speed or not ;) + //static void findNewDocuments( DocLnkSet* folder ); static QString applicationFileName(const QString& appname, const QString& filename); @@ -77,6 +80,11 @@ public: static QString shellQuote(const QString& s); static QString stringQuote(const QString& s); +#ifdef QTOPIA_INTERNAL_LANGLIST + static QStringList languageList(); + static QStringList helpPath(); +#endif + private: static Command* builtin; static QGuardedPtr *running; diff --git a/library/storage.cpp b/library/storage.cpp index bd34a5f..a4c96be 100644 --- a/library/storage.cpp +++ b/library/storage.cpp @@ -1,4 +1,5 @@ /********************************************************************** +** Copyright (C) Holger 'zecke' Freyther ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. @@ -23,6 +24,7 @@ #include #endif +#include #include #include @@ -84,7 +86,8 @@ void StorageInfo::cardMessage( const QCString& msg, const QByteArray& ) if ( msg == "mtabChanged()" ) update(); } - +// cause of the lack of a d pointer we need +// to store informations in a config file :( void StorageInfo::update() { //qDebug("StorageInfo::updating"); -- cgit v0.9.0.2