summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-11 00:52:25 (UTC)
committer alwin <alwin>2004-11-11 00:52:25 (UTC)
commit75c24d504700b1810c94c970e40de953bc3a4779 (patch) (unidiff)
treec55dc293a72e4f9079c8f8f1cf987f1363a751d1
parent79060b829e9231cddc0acfe2dd2b7da3f13dfbc4 (diff)
downloadopie-75c24d504700b1810c94c970e40de953bc3a4779.zip
opie-75c24d504700b1810c94c970e40de953bc3a4779.tar.gz
opie-75c24d504700b1810c94c970e40de953bc3a4779.tar.bz2
speed up cat selection
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.cpp11
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.h4
2 files changed, 11 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
index d60149f..e43baed 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
@@ -37,8 +37,9 @@ Doc_DirLister::Doc_DirLister()
37 this, SLOT(slotThumbNail(const QString&, const QPixmap&)) ); 37 this, SLOT(slotThumbNail(const QString&, const QPixmap&)) );
38 38
39 m_namemap.clear(); 39 m_namemap.clear();
40 m_filemap.clear(); 40 m_filemap.clear();
41 m_docreads = false;
41} 42}
42 43
43QString Doc_DirLister::defaultPath()const { 44QString Doc_DirLister::defaultPath()const {
44 return QString::null; 45 return QString::null;
@@ -55,13 +56,15 @@ bool Doc_DirLister::matchCat(const AppLnk* app)
55 56
56QString Doc_DirLister::setStartPath(const QString&) { 57QString Doc_DirLister::setStartPath(const QString&) {
57 static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png"); 58 static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png");
58 if (m_namemap.isEmpty()) { 59 if (m_namemap.isEmpty()) {
59 DocLnkSet ds; 60 if (!m_docreads) {
60 Global::findDocuments(&ds,Mtype_str); 61 Global::findDocuments(&m_ds,Mtype_str);
61 QListIterator<DocLnk> dit(ds.children()); 62 m_docreads = true;
63 }
64 QListIterator<DocLnk> dit(m_ds.children());
62 for( ; dit.current(); ++dit) { 65 for( ; dit.current(); ++dit) {
63 if (! (*dit)->isValid()) continue; 66// if (! (*dit)->isValid()) continue;
64 if (!matchCat((*dit))) continue; 67 if (!matchCat((*dit))) continue;
65 m_namemap[(*dit)->name()]=(*dit)->file(); 68 m_namemap[(*dit)->name()]=(*dit)->file();
66 m_filemap[(*dit)->file()]=(*dit)->name(); 69 m_filemap[(*dit)->file()]=(*dit)->name();
67 } 70 }
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.h b/noncore/graphics/opie-eye/impl/doc/doc_lister.h
index e148ac0..403241c 100644
--- a/noncore/graphics/opie-eye/impl/doc/doc_lister.h
+++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.h
@@ -6,8 +6,10 @@
6#define DOC_LISTER_INTERFACE_LISTER_H 6#define DOC_LISTER_INTERFACE_LISTER_H
7 7
8#include <iface/dirlister.h> 8#include <iface/dirlister.h>
9 9
10#include <qpe/applnk.h>
11
10#include <qstring.h> 12#include <qstring.h>
11#include <qmap.h> 13#include <qmap.h>
12 14
13class Config; 15class Config;
@@ -37,8 +39,10 @@ public:
37private: 39private:
38 QMap<QString,QString> m_namemap,m_filemap; 40 QMap<QString,QString> m_namemap,m_filemap;
39 int m_catFilter; 41 int m_catFilter;
40 bool matchCat(const AppLnk* app); 42 bool matchCat(const AppLnk* app);
43 bool m_docreads;
44 DocLnkSet m_ds;
41 45
42protected slots: 46protected slots:
43 virtual void slotFullInfo(const QString&, const QString&); 47 virtual void slotFullInfo(const QString&, const QString&);
44 virtual void slotThumbInfo(const QString&, const QString&); 48 virtual void slotThumbInfo(const QString&, const QString&);