summaryrefslogtreecommitdiff
path: root/library
authoralwin <alwin>2004-02-24 13:25:40 (UTC)
committer alwin <alwin>2004-02-24 13:25:40 (UTC)
commit6b6ba7aa1bf21647a804c7e5e7e1654112c3ee38 (patch) (side-by-side diff)
tree6d202c80e470686ec72680e3371d15e0fb987c3b /library
parent911473db35a9fce5f3589f03c27210456faaba86 (diff)
downloadopie-6b6ba7aa1bf21647a804c7e5e7e1654112c3ee38.zip
opie-6b6ba7aa1bf21647a804c7e5e7e1654112c3ee38.tar.gz
opie-6b6ba7aa1bf21647a804c7e5e7e1654112c3ee38.tar.bz2
use Config for checking if the medium should be checked
Diffstat (limited to 'library') (more/less context) (show whitespace changes)
-rw-r--r--library/global.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/library/global.cpp b/library/global.cpp
index 4aca08b..a627348 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -50,26 +50,6 @@
#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("check = 0" ) ){
- return false;
- }else if( (*it).startsWith("check = 1" ) ){
- return true;
- }
- }
- return true;
- }
-}
-
//#include "quickexec_p.h"
class Emitter : public QObject {
@@ -769,9 +749,11 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter)
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;
Config conf((*it)->path() + "/.opiestorage.cf", Config::File );
+ conf.setGroup("main");
+ if (!conf.readBoolEntry("check",true)) {
+ continue;
+ }
conf.setGroup("subdirs");
if (conf.readBoolEntry("wholemedia",true)) {
DocLnkSet ide( path,mimefilter);