From 8269dfa474065b986375de7c4fd380cbda837a12 Mon Sep 17 00:00:00 2001 From: alwin Date: Wed, 21 Apr 2004 20:43:51 +0000 Subject: some performance issues fixed a crasher in mainwindow --- diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 087db30..77597d2 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -239,7 +239,9 @@ void PIconView::initKeys() { /* * change one dir up */ -void PIconView::slotDirUp() { +void PIconView::slotDirUp() +{ + if (m_path.isEmpty()) return; QDir dir( m_path ); dir.cdUp(); slotChangeDir( dir.absPath() ); @@ -580,6 +582,8 @@ void PIconView::slotChangeMode( int mode ) { m_mode = mode; m_cfg->writeEntry("ListViewMode", m_mode); + /* performance! */ + m_view->clear(); calculateGrid(); slotReloadDir(); } diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 058fca0..ec6b051 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -224,6 +224,7 @@ void PMainWindow::slotConfig() { PDirView *view = (_it.data())(*m_cfg); PInterfaceInfo *inf = view->interfaceInfo(); QWidget *_wid = inf->configWidget( *m_cfg ); + if (!_wid) continue; _wid->reparent(wid, QPoint() ); lst.insert( view, _wid ); wid->addTab( _wid, "fileopen", inf->name() ); 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 @@ -31,32 +31,31 @@ Doc_DirLister::Doc_DirLister() connect( master, SIGNAL(sig_thumbNail(const QString&, const QPixmap&)), this, SLOT(slotThumbNail(const QString&, const QPixmap&)) ); + m_namemap.clear(); + m_filemap.clear(); } QString Doc_DirLister::defaultPath()const { return ""; QPEApplication::documentDir(); } -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 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 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; } @@ -65,10 +64,16 @@ QStringList Doc_DirLister::folders()const { } QStringList Doc_DirLister::files()const { - return m_out; + QStringList out; + QMap::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& ) +{ } void Doc_DirLister::thumbNail( const QString& str, int w, int h) { @@ -95,7 +100,6 @@ void Doc_DirLister::imageInfo( const QString& str) { return; } QString fname = m_namemap[str]; - owarn << "Image info: " << fname << oendl; SlaveMaster::self()->thumbInfo( fname ); } diff --git a/noncore/graphics/opie-eye/impl/doc/doc_lister.h b/noncore/graphics/opie-eye/impl/doc/doc_lister.h index d89b579..a65b616 100644 --- a/noncore/graphics/opie-eye/impl/doc/doc_lister.h +++ b/noncore/graphics/opie-eye/impl/doc/doc_lister.h @@ -32,7 +32,6 @@ public: private: QMap m_namemap,m_filemap; - QStringList m_out; protected slots: virtual void slotFullInfo(const QString&, const QString&); virtual void slotThumbInfo(const QString&, const QString&); -- cgit v0.9.0.2