summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/iconview.cpp
authoralwin <alwin>2004-04-21 18:31:44 (UTC)
committer alwin <alwin>2004-04-21 18:31:44 (UTC)
commit81cd1a4a916fb00b6c8867bdc1d945db155b12c0 (patch) (side-by-side diff)
treece302c254c8c2160a86ffc0a5abe6cfd51fd33b3 /noncore/graphics/opie-eye/gui/iconview.cpp
parentac414fa3802b471857bc84ecdd0d37200541b0a7 (diff)
downloadopie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.zip
opie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.tar.gz
opie-81cd1a4a916fb00b6c8867bdc1d945db155b12c0.tar.bz2
- added DocView mode
- fixed a bug in iconview and some small fixes more
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.cpp31
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
@@ -347,3 +347,3 @@ void PIconView::loadViews() {
for ( it = map->begin(); it != map->end(); ++it )
- m_views->insertItem( QObject::tr(it.key() ) );
+ m_views->insertItem( it.key() );
}
@@ -364,5 +364,11 @@ 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 );
@@ -408,5 +414,9 @@ void PIconView::addFiles( const QStringList& lst) {
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) {
@@ -545,3 +555,2 @@ void PIconView::slotShowImage()
if (isDir) return;
-
slotShowImage( name );
@@ -549,3 +558,5 @@ void PIconView::slotShowImage()
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 );
}
@@ -560,3 +571,5 @@ 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 );
}
@@ -581,4 +594,2 @@ 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();