summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye
Side-by-side diff
Diffstat (limited to 'noncore/graphics/opie-eye') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp22
1 files changed, 18 insertions, 4 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,3 +183,16 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
loadViews();
- slotViewChanged( m_views->currentItem() );
+ 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);