Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 660c4fa..087db30 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -346,5 +346,5 @@ void PIconView::loadViews() { ViewMap* map = viewMap(); for ( it = map->begin(); it != map->end(); ++it ) - m_views->insertItem( QObject::tr(it.key() ) ); + m_views->insertItem( it.key() ); } @@ -363,7 +363,13 @@ void PIconView::slotViewChanged( int i) { PDirView* cur = currentView(); - delete cur; + if (cur) delete cur; QString str = m_views->text(i); - cur = (*(*viewMap())[str])(*m_cfg); + ViewMap* map = viewMap(); + if (!map) {setCurrentView(0l); return;} + if (map->find(str) == map->end()) { + owarn << "Key not found" << oendl; + setCurrentView(0l); return; + } + cur = (*(*map)[str])(*m_cfg); setCurrentView( cur ); @@ -407,7 +413,11 @@ void PIconView::addFiles( const QStringList& lst) { IconViewItem * _iv; QPixmap*m_pix = 0; + QString pre = ""; + if (!m_path.isEmpty()) { + pre = m_path+"/"; + } for (it=lst.begin(); it!= lst.end(); ++it ) { - m_pix = PPixmapCache::self()->cachedImage( m_path+"/"+(*it), 64, 64 ); - _iv = new IconViewItem( m_view, m_path+"/"+(*it), (*it) ); + m_pix = PPixmapCache::self()->cachedImage( pre+(*it), 64, 64 ); + _iv = new IconViewItem( m_view, pre+(*it), (*it) ); if (m_mode==3) { _iv->setTextOnly(true); @@ -544,9 +554,10 @@ void PIconView::slotShowImage() QString name = currentFileName(isDir); if (isDir) return; - slotShowImage( name ); } void PIconView::slotShowImage( const QString& name) { - emit sig_display( name ); + PDirLister *lister = currentView()->dirLister(); + QString r_name = lister->nameToFname(name); + emit sig_display( r_name ); } void PIconView::slotImageInfo() { @@ -559,5 +570,7 @@ void PIconView::slotImageInfo() { void PIconView::slotImageInfo( const QString& name) { - emit sig_showInfo( name ); + PDirLister *lister = currentView()->dirLister(); + QString r_name = lister->nameToFname(name); + emit sig_showInfo(r_name ); } @@ -580,6 +593,4 @@ void PIconView::resizeEvent( QResizeEvent* re ) { void PIconView::calculateGrid() { - odebug << "Calc grid: x=" << m_view->gridX() << " y=" << m_view->gridY() << oendl; - odebug << "Size of view: " << m_view->size() << oendl; int dw = QApplication::desktop()->width(); int viewerWidth = dw-style().scrollBarExtent().width(); |