summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -47,32 +47,12 @@
#include <qwindowsystem_qws.h> // for qwsServer
#include <qdatetime.h>
#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 {
Q_OBJECT
public:
Emitter( QWidget* receiver, const QString& document )
@@ -766,15 +746,17 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter)
const QList<FileSystem> &fs = storage.fileSystems();
QListIterator<FileSystem> it ( fs );
for ( ; it.current(); ++it ) {
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);
folder->appendFrom(ide);
} else {
QStringList subDirs = conf.readListEntry("subdirs",':');