author | alwin <alwin> | 2004-04-21 20:43:51 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-21 20:43:51 (UTC) |
commit | 8269dfa474065b986375de7c4fd380cbda837a12 (patch) (side-by-side diff) | |
tree | 0c73c9457032d5cf3957092a6ad1153a86eb2f29 /noncore/graphics/opie-eye/impl/doc/doc_lister.cpp | |
parent | 81cd1a4a916fb00b6c8867bdc1d945db155b12c0 (diff) | |
download | opie-8269dfa474065b986375de7c4fd380cbda837a12.zip opie-8269dfa474065b986375de7c4fd380cbda837a12.tar.gz opie-8269dfa474065b986375de7c4fd380cbda837a12.tar.bz2 |
some performance issues
fixed a crasher in mainwindow
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.cpp | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp index f695a76..73b2863 100644 --- a/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp +++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.cpp @@ -32,4 +32,6 @@ Doc_DirLister::Doc_DirLister() this, SLOT(slotThumbNail(const QString&, const QPixmap&)) ); + m_namemap.clear(); + m_filemap.clear(); } @@ -38,24 +40,21 @@ QString Doc_DirLister::defaultPath()const { } -QString Doc_DirLister::setStartPath( const QString& path ) { - m_namemap.clear(); - m_out.clear(); +QString Doc_DirLister::setStartPath(const QString&) { static const QString Mtype_str("image/jpeg;image/gif;image/bmp;image/png"); - owarn << "Set start path" << oendl; - DocLnkSet ds; - Global::findDocuments(&ds,Mtype_str); - QListIterator<DocLnk> dit(ds.children()); - for( ; dit.current(); ++dit) { - owarn << (*dit)->file() << oendl; - m_namemap[(*dit)->name()]=(*dit)->file(); - m_filemap[(*dit)->file()]=(*dit)->name(); - m_out.append((*dit)->name()); + if (m_namemap.isEmpty()) { + DocLnkSet ds; + Global::findDocuments(&ds,Mtype_str); + QListIterator<DocLnk> dit(ds.children()); + for( ; dit.current(); ++dit) { + owarn << (*dit)->file() << oendl; + m_namemap[(*dit)->name()]=(*dit)->file(); + m_filemap[(*dit)->file()]=(*dit)->name(); + } } - owarn << "Set start path end" << oendl; - return ""; + return QString::null; } QString Doc_DirLister::currentPath()const { - return ""; + return QString::null; } @@ -66,8 +65,14 @@ QStringList Doc_DirLister::folders()const { QStringList Doc_DirLister::files()const { - return m_out; + QStringList out; + QMap<QString,QString>::ConstIterator it; + for (it = m_namemap.begin();it != m_namemap.end();++it) { + out.append(it.key()); + } + return out; } -void Doc_DirLister::deleteImage( const QString& ) { +void Doc_DirLister::deleteImage( const QString& ) +{ } @@ -96,5 +101,4 @@ void Doc_DirLister::imageInfo( const QString& str) { } QString fname = m_namemap[str]; - owarn << "Image info: " << fname << oendl; SlaveMaster::self()->thumbInfo( fname ); } |