summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2002-03-24 19:31:32 (UTC)
committer zecke <zecke>2002-03-24 19:31:32 (UTC)
commiteb813af4c1e301c8ba015627a1da04f8199a3be2 (patch) (unidiff)
tree7f23f61c2d8c58655fc98798b7f1b4aec75b5ff3 /library
parent4802684dd785274be50b472c87e315da0e325449 (diff)
downloadopie-eb813af4c1e301c8ba015627a1da04f8199a3be2.zip
opie-eb813af4c1e301c8ba015627a1da04f8199a3be2.tar.gz
opie-eb813af4c1e301c8ba015627a1da04f8199a3be2.tar.bz2
Here is the second chunk of bits to make things a bit more fast
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/global.cpp27
-rw-r--r--library/global.h8
-rw-r--r--library/storage.cpp5
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
@@ -49,4 +49,26 @@
49#include <qdatetime.h> 49#include <qdatetime.h>
50 50
51#include <qfile.h>
52
53namespace {
54 // checks if the storage should be searched
55 bool checkStorage(const QString &path ){ // this is a small Config replacement cause config is too limited -zecke
56 QFile file(path );
57 if(!file.open(IO_ReadOnly ) )
58 return true;
59
60 QByteArray array = file.readAll();
61 QStringList list = QStringList::split('\n', QString( array ) );
62 for(QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
63 if( (*it).startsWith("autocheck = 0" ) ){
64 return true;
65 }else if( (*it).startsWith("autocheck = 1" ) ){
66 return false;
67 }
68 }
69 return true;
70 }
71}
72
51//#include "quickexec_p.h" 73//#include "quickexec_p.h"
52 74
@@ -639,6 +661,9 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter)
639 QListIterator<FileSystem> it ( fs ); 661 QListIterator<FileSystem> it ( fs );
640 for ( ; it.current(); ++it ) { 662 for ( ; it.current(); ++it ) {
641 if ( (*it)->isRemovable() ) { 663 if ( (*it)->isRemovable() ) { // let's find out if we should search on it
664 // this is a candidate look at the cf and see if we should search on it
642 QString path = (*it)->path(); 665 QString path = (*it)->path();
666 if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) )
667 continue;
643 DocLnkSet ide( path, mimefilter ); 668 DocLnkSet ide( path, mimefilter );
644 folder->appendFrom(ide); 669 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,3 +1,4 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Holger 'zecke' Freyther <freyther@kde.org>
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 4**
@@ -46,4 +47,6 @@ public:
46 47
47 static void findDocuments(DocLnkSet* folder, const QString &mimefilter=QString::null); 48 static void findDocuments(DocLnkSet* folder, const QString &mimefilter=QString::null);
49 // we don't need a mimefilter. Same as above but this is fast as light speed or not ;)
50 //static void findNewDocuments( DocLnkSet* folder );
48 51
49 static QString applicationFileName(const QString& appname, const QString& filename); 52 static QString applicationFileName(const QString& appname, const QString& filename);
@@ -78,4 +81,9 @@ public:
78 static QString stringQuote(const QString& s); 81 static QString stringQuote(const QString& s);
79 82
83#ifdef QTOPIA_INTERNAL_LANGLIST
84 static QStringList languageList();
85 static QStringList helpPath();
86#endif
87
80private: 88private:
81 static Command* builtin; 89 static Command* builtin;
diff --git a/library/storage.cpp b/library/storage.cpp
index bd34a5f..a4c96be 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -1,3 +1,4 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org>
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 4**
@@ -24,4 +25,5 @@
24#endif 25#endif
25 26
27#include <qfile.h>
26#include <qtimer.h> 28#include <qtimer.h>
27#include <qcopchannel_qws.h> 29#include <qcopchannel_qws.h>
@@ -85,5 +87,6 @@ void StorageInfo::cardMessage( const QCString& msg, const QByteArray& )
85 update(); 87 update();
86} 88}
87 89// cause of the lack of a d pointer we need
90// to store informations in a config file :(
88void StorageInfo::update() 91void StorageInfo::update()
89{ 92{