Diffstat (limited to 'noncore/graphics/opie-eye/gui/iconview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 77597d2..6c5f5ea 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -162,4 +162,2 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) m_views = new QComboBox( hbox, "View As" ); - connect( m_views, SIGNAL(activated(int)), - this, SLOT(slotViewChanged(int)) ); @@ -173,3 +171,4 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) - m_mode = cfg->readNumEntry("ListViewMode", 1); + m_mode = m_cfg->readNumEntry("ListViewMode", 1); + QString lastView = m_cfg->readEntry("LastView",""); @@ -184,4 +183,17 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) loadViews(); + int cc=0; + for (; cc<m_views->count();++cc) { + if (m_views->text(cc)==lastView) { + break; + } + } + if (cc<m_views->count()) { + m_views->setCurrentItem(cc); + slotViewChanged(cc); + } else { slotViewChanged( m_views->currentItem() ); } + connect( m_views, SIGNAL(activated(int)), + this, SLOT(slotViewChanged(int)) ); +} @@ -374,2 +386,4 @@ void PIconView::slotViewChanged( int i) { } + m_cfg->writeEntry("LastView",str); + m_cfg->write(); cur = (*(*map)[str])(*m_cfg); |