author | alwin <alwin> | 2004-04-21 23:15:47 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-21 23:15:47 (UTC) |
commit | 9230c9dd6bef33603cef1727be95dafc8065f66c (patch) (unidiff) | |
tree | 076da2786297367a15e8929784933d8e9bd02576 | |
parent | 15abdc3ac4e7406d15a8a59f43b3ae669099074a (diff) | |
download | opie-9230c9dd6bef33603cef1727be95dafc8065f66c.zip opie-9230c9dd6bef33603cef1727be95dafc8065f66c.tar.gz opie-9230c9dd6bef33603cef1727be95dafc8065f66c.tar.bz2 |
saves the last view used.
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 22 |
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 ) | |||
162 | m_views = new QComboBox( hbox, "View As" ); | 162 | m_views = new QComboBox( hbox, "View As" ); |
163 | connect( m_views, SIGNAL(activated(int)), | ||
164 | this, SLOT(slotViewChanged(int)) ); | ||
165 | 163 | ||
@@ -173,3 +171,4 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
173 | 171 | ||
174 | m_mode = cfg->readNumEntry("ListViewMode", 1); | 172 | m_mode = m_cfg->readNumEntry("ListViewMode", 1); |
173 | QString lastView = m_cfg->readEntry("LastView",""); | ||
175 | 174 | ||
@@ -184,3 +183,16 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
184 | loadViews(); | 183 | loadViews(); |
185 | slotViewChanged( m_views->currentItem() ); | 184 | int cc=0; |
185 | for (; cc<m_views->count();++cc) { | ||
186 | if (m_views->text(cc)==lastView) { | ||
187 | break; | ||
188 | } | ||
189 | } | ||
190 | if (cc<m_views->count()) { | ||
191 | m_views->setCurrentItem(cc); | ||
192 | slotViewChanged(cc); | ||
193 | } else { | ||
194 | slotViewChanged(m_views->currentItem()); | ||
195 | } | ||
196 | connect( m_views, SIGNAL(activated(int)), | ||
197 | this, SLOT(slotViewChanged(int)) ); | ||
186 | } | 198 | } |
@@ -374,2 +386,4 @@ void PIconView::slotViewChanged( int i) { | |||
374 | } | 386 | } |
387 | m_cfg->writeEntry("LastView",str); | ||
388 | m_cfg->write(); | ||
375 | cur = (*(*map)[str])(*m_cfg); | 389 | cur = (*(*map)[str])(*m_cfg); |