author | zecke <zecke> | 2002-03-24 19:31:32 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-03-24 19:31:32 (UTC) |
commit | eb813af4c1e301c8ba015627a1da04f8199a3be2 (patch) (side-by-side diff) | |
tree | 7f23f61c2d8c58655fc98798b7f1b4aec75b5ff3 | |
parent | 4802684dd785274be50b472c87e315da0e325449 (diff) | |
download | opie-eb813af4c1e301c8ba015627a1da04f8199a3be2.zip opie-eb813af4c1e301c8ba015627a1da04f8199a3be2.tar.gz opie-eb813af4c1e301c8ba015627a1da04f8199a3be2.tar.bz2 |
Here is the second chunk of bits to make things a bit more fast
-rw-r--r-- | library/global.cpp | 27 | ||||
-rw-r--r-- | library/global.h | 8 | ||||
-rw-r--r-- | library/storage.cpp | 5 |
3 files changed, 38 insertions, 2 deletions
diff --git a/library/global.cpp b/library/global.cpp index dd15eb7..5a28595 100644 --- a/library/global.cpp +++ b/library/global.cpp @@ -50,2 +50,24 @@ +#include <qfile.h> + +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" @@ -640,4 +662,7 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) for ( ; it.current(); ++it ) { - if ( (*it)->isRemovable() ) { + 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 ); diff --git a/library/global.h b/library/global.h index d9ff8f8..fdf8754 100644 --- a/library/global.h +++ b/library/global.h @@ -1,2 +1,3 @@ /********************************************************************** +** Copyright (C) 2002 Holger 'zecke' Freyther <freyther@kde.org> ** Copyright (C) 2000 Trolltech AS. All rights reserved. @@ -47,2 +48,4 @@ public: 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 ); @@ -79,2 +82,7 @@ public: +#ifdef QTOPIA_INTERNAL_LANGLIST + static QStringList languageList(); + static QStringList helpPath(); +#endif + private: diff --git a/library/storage.cpp b/library/storage.cpp index bd34a5f..a4c96be 100644 --- a/library/storage.cpp +++ b/library/storage.cpp @@ -1,2 +1,3 @@ /********************************************************************** +** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org> ** Copyright (C) 2000 Trolltech AS. All rights reserved. @@ -25,2 +26,3 @@ +#include <qfile.h> #include <qtimer.h> @@ -86,3 +88,4 @@ void StorageInfo::cardMessage( const QCString& msg, const QByteArray& ) } - +// cause of the lack of a d pointer we need +// to store informations in a config file :( void StorageInfo::update() |