-rw-r--r-- | library/global.cpp | 26 |
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 @@ | |||
50 | 50 | ||
51 | #include <qfile.h> | 51 | #include <qfile.h> |
52 | 52 | ||
53 | namespace { | ||
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("check = 0" ) ){ | ||
64 | return false; | ||
65 | }else if( (*it).startsWith("check = 1" ) ){ | ||
66 | return true; | ||
67 | } | ||
68 | } | ||
69 | return true; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | //#include "quickexec_p.h" | 53 | //#include "quickexec_p.h" |
74 | 54 | ||
75 | class Emitter : public QObject { | 55 | class Emitter : public QObject { |
@@ -769,9 +749,11 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) | |||
769 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it | 749 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it |
770 | // this is a candidate look at the cf and see if we should search on it | 750 | // this is a candidate look at the cf and see if we should search on it |
771 | QString path = (*it)->path(); | 751 | QString path = (*it)->path(); |
772 | if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) ) | ||
773 | continue; | ||
774 | Config conf((*it)->path() + "/.opiestorage.cf", Config::File ); | 752 | Config conf((*it)->path() + "/.opiestorage.cf", Config::File ); |
753 | conf.setGroup("main"); | ||
754 | if (!conf.readBoolEntry("check",true)) { | ||
755 | continue; | ||
756 | } | ||
775 | conf.setGroup("subdirs"); | 757 | conf.setGroup("subdirs"); |
776 | if (conf.readBoolEntry("wholemedia",true)) { | 758 | if (conf.readBoolEntry("wholemedia",true)) { |
777 | DocLnkSet ide( path,mimefilter); | 759 | DocLnkSet ide( path,mimefilter); |