author | leseb <leseb> | 2002-08-30 18:10:11 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-08-30 18:10:11 (UTC) |
commit | b5ec106e5f612042987397a5a5b6683fdabaf793 (patch) (unidiff) | |
tree | 58da0aac60a7a39cca162fe222107c9e3d676dac /library/global.cpp | |
parent | f6125710c0ca99fc62ffce69973a168b6604f29d (diff) | |
download | opie-b5ec106e5f612042987397a5a5b6683fdabaf793.zip opie-b5ec106e5f612042987397a5a5b6683fdabaf793.tar.gz opie-b5ec106e5f612042987397a5a5b6683fdabaf793.tar.bz2 |
Try to handle RAM storage for documents
-rw-r--r-- | library/global.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/global.cpp b/library/global.cpp index edb7b85..ab27b3f 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -652,64 +652,68 @@ QString Global::stringQuote(const QString& s) | |||
652 | objects to \a folder. | 652 | objects to \a folder. |
653 | */ | 653 | */ |
654 | void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) | 654 | void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) |
655 | { | 655 | { |
656 | QString homedocs = QString(getenv("HOME")) + "/Documents"; | 656 | QString homedocs = QString(getenv("HOME")) + "/Documents"; |
657 | DocLnkSet d(homedocs,mimefilter); | 657 | DocLnkSet d(homedocs,mimefilter); |
658 | folder->appendFrom(d); | 658 | folder->appendFrom(d); |
659 | /** let's do intellegint way of searching these files | 659 | /** let's do intellegint way of searching these files |
660 | * a) the user don't want to check mediums global | 660 | * a) the user don't want to check mediums global |
661 | * b) the user wants to check but use the global options for it | 661 | * b) the user wants to check but use the global options for it |
662 | * c) the user wants to check it but not this medium | 662 | * c) the user wants to check it but not this medium |
663 | * d) the user wants to check and this medium as well | 663 | * d) the user wants to check and this medium as well |
664 | * | 664 | * |
665 | * In all cases we need to apply a different mimefilter to | 665 | * In all cases we need to apply a different mimefilter to |
666 | * the medium. | 666 | * the medium. |
667 | * a) mimefilter.isEmpty() we need to apply the responding filter | 667 | * a) mimefilter.isEmpty() we need to apply the responding filter |
668 | * either the global or the one on the medium | 668 | * either the global or the one on the medium |
669 | * | 669 | * |
670 | * b) mimefilter is set to an application we need to find out if the | 670 | * b) mimefilter is set to an application we need to find out if the |
671 | * mimetypes are included in the mime mask of the medium | 671 | * mimetypes are included in the mime mask of the medium |
672 | */ | 672 | */ |
673 | StorageInfo storage; | 673 | StorageInfo storage; |
674 | const QList<FileSystem> &fs = storage.fileSystems(); | 674 | const QList<FileSystem> &fs = storage.fileSystems(); |
675 | QListIterator<FileSystem> it ( fs ); | 675 | QListIterator<FileSystem> it ( fs ); |
676 | for ( ; it.current(); ++it ) { | 676 | for ( ; it.current(); ++it ) { |
677 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it | 677 | if ( (*it)->isRemovable() ) { // let's find out if we should search on it |
678 | // this is a candidate look at the cf and see if we should search on it | 678 | // this is a candidate look at the cf and see if we should search on it |
679 | QString path = (*it)->path(); | 679 | QString path = (*it)->path(); |
680 | if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) ) | 680 | if( !checkStorage((*it)->path() + "/.opiestorage.cf" ) ) |
681 | continue; | 681 | continue; |
682 | DocLnkSet ide( path, mimefilter ); | 682 | DocLnkSet ide( path, mimefilter ); |
683 | folder->appendFrom(ide); | 683 | folder->appendFrom(ide); |
684 | } else if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) { | ||
685 | QString path = (*it)->path() + "/Documents"; | ||
686 | DocLnkSet ide( path, mimefilter ); | ||
687 | folder->appendFrom(ide); | ||
684 | } | 688 | } |
685 | } | 689 | } |
686 | } | 690 | } |
687 | 691 | ||
688 | QStringList Global::languageList() | 692 | QStringList Global::languageList() |
689 | { | 693 | { |
690 | QString lang = getenv("LANG"); | 694 | QString lang = getenv("LANG"); |
691 | QStringList langs; | 695 | QStringList langs; |
692 | langs.append(lang); | 696 | langs.append(lang); |
693 | int i = lang.find("."); | 697 | int i = lang.find("."); |
694 | if ( i > 0 ) | 698 | if ( i > 0 ) |
695 | lang = lang.left( i ); | 699 | lang = lang.left( i ); |
696 | i = lang.find( "_" ); | 700 | i = lang.find( "_" ); |
697 | if ( i > 0 ) | 701 | if ( i > 0 ) |
698 | langs.append(lang.left(i)); | 702 | langs.append(lang.left(i)); |
699 | return langs; | 703 | return langs; |
700 | } | 704 | } |
701 | 705 | ||
702 | QStringList Global::helpPath() | 706 | QStringList Global::helpPath() |
703 | { | 707 | { |
704 | QStringList path; | 708 | QStringList path; |
705 | QStringList langs = Global::languageList(); | 709 | QStringList langs = Global::languageList(); |
706 | for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) { | 710 | for (QStringList::ConstIterator it = langs.fromLast(); it!=langs.end(); --it) { |
707 | QString lang = *it; | 711 | QString lang = *it; |
708 | if ( !lang.isEmpty() ) | 712 | if ( !lang.isEmpty() ) |
709 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; | 713 | path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; |
710 | } | 714 | } |
711 | path += QPEApplication::qpeDir() + "/pics"; | 715 | path += QPEApplication::qpeDir() + "/pics"; |
712 | path += QPEApplication::qpeDir() + "/help/en/html"; | 716 | path += QPEApplication::qpeDir() + "/help/en/html"; |
713 | path += QPEApplication::qpeDir() + "/docs"; | 717 | path += QPEApplication::qpeDir() + "/docs"; |
714 | QString dir = QDir::current().canonicalPath(); | 718 | QString dir = QDir::current().canonicalPath(); |
715 | if ( dir == "/" ) | 719 | if ( dir == "/" ) |