author | alwin <alwin> | 2004-11-11 00:52:25 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-11 00:52:25 (UTC) |
commit | 75c24d504700b1810c94c970e40de953bc3a4779 (patch) (unidiff) | |
tree | c55dc293a72e4f9079c8f8f1cf987f1363a751d1 | |
parent | 79060b829e9231cddc0acfe2dd2b7da3f13dfbc4 (diff) | |
download | opie-75c24d504700b1810c94c970e40de953bc3a4779.zip opie-75c24d504700b1810c94c970e40de953bc3a4779.tar.gz opie-75c24d504700b1810c94c970e40de953bc3a4779.tar.bz2 |
speed up cat selection
-rw-r--r-- | noncore/graphics/opie-eye/impl/doc/doc_lister.cpp | 11 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/impl/doc/doc_lister.h | 4 |
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 | |||
@@ -38,6 +38,7 @@ Doc_DirLister::Doc_DirLister() | |||
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 | ||
43 | QString Doc_DirLister::defaultPath()const { | 44 | QString Doc_DirLister::defaultPath()const { |
@@ -56,11 +57,13 @@ bool Doc_DirLister::matchCat(const AppLnk* app) | |||
56 | QString Doc_DirLister::setStartPath(const QString&) { | 57 | QString 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(); |
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 | |||
@@ -7,6 +7,8 @@ | |||
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 | ||
@@ -38,6 +40,8 @@ private: | |||
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 | ||
42 | protected slots: | 46 | protected slots: |
43 | virtual void slotFullInfo(const QString&, const QString&); | 47 | virtual void slotFullInfo(const QString&, const QString&); |