summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp
Side-by-side diff
Diffstat (limited to 'noncore/graphics/opie-eye/impl/doc/doc_lister.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/impl/doc/doc_lister.cpp11
1 files changed, 7 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
@@ -17,71 +17,74 @@
using namespace Opie::Core;
/* QT */
#include <qdir.h>
#include <qfileinfo.h>
Doc_DirLister::Doc_DirLister()
: PDirLister( "doc_dir_lister" )
{
/* connect the signals */
m_catFilter = 0;
SlaveMaster* master = SlaveMaster::self();
connect( master, SIGNAL(sig_start()), this, SIGNAL(sig_start()) );
connect( master, SIGNAL(sig_end()), this, SIGNAL(sig_end()) );
connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)),
this, SLOT(slotThumbInfo(const QString&, const QString&)) );
connect( master, SIGNAL(sig_fullInfo(const QString&, const QString&)),
this, SLOT(slotFullInfo(const QString&, const QString&)) );
connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)),
this, SLOT(slotThumbNail(const QString&, const QPixmap&)) );
m_namemap.clear();
m_filemap.clear();
+ m_docreads = false;
}
QString Doc_DirLister::defaultPath()const {
return QString::null;
}
bool Doc_DirLister::matchCat(const AppLnk* app)
{
if (!app) return false;
if (m_catFilter==0 || app->categories().contains(m_catFilter) || m_catFilter == -1 && app->categories().count() == 0 ) {
return true;
}
return false;
}
QString Doc_DirLister::setStartPath(const QString&) {
static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png");
if (m_namemap.isEmpty()) {
- DocLnkSet ds;
- Global::findDocuments(&ds,Mtype_str);
- QListIterator<DocLnk> dit(ds.children());
+ if (!m_docreads) {
+ Global::findDocuments(&m_ds,Mtype_str);
+ m_docreads = true;
+ }
+ QListIterator<DocLnk> dit(m_ds.children());
for( ; dit.current(); ++dit) {
- if (! (*dit)->isValid()) continue;
+// if (! (*dit)->isValid()) continue;
if (!matchCat((*dit))) continue;
m_namemap[(*dit)->name()]=(*dit)->file();
m_filemap[(*dit)->file()]=(*dit)->name();
}
}
return QString::null;
}
QString Doc_DirLister::currentPath()const {
return QString::null;
}
QStringList Doc_DirLister::folders()const {
return QStringList();
}
QStringList Doc_DirLister::files()const {
QStringList out;
QMap<QString,QString>::ConstIterator it;
for (it = m_namemap.begin();it != m_namemap.end();++it) {
out.append(it.key());
}
return out;