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 | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 5633312..f6e1816 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -268,6 +268,35 @@ QString PIconView::currentFileName(bool &isDir)const { | |||
268 | return it->path(); | 268 | return it->path(); |
269 | } | 269 | } |
270 | 270 | ||
271 | QString PIconView::nextFileName(bool &isDir)const | ||
272 | { | ||
273 | isDir = false; | ||
274 | QIconViewItem* _it1 = m_view->currentItem(); | ||
275 | if ( !_it1 ) | ||
276 | return QString::null; | ||
277 | QIconViewItem* _it = _it1->nextItem(); | ||
278 | if ( !_it ) | ||
279 | return QString::null; | ||
280 | IconViewItem* it = static_cast<IconViewItem*>( _it ); | ||
281 | isDir = it->isDir(); | ||
282 | m_view->setCurrentItem(_it); | ||
283 | return it->path(); | ||
284 | } | ||
285 | |||
286 | QString PIconView::prevFileName(bool &isDir)const{ | ||
287 | isDir = false; | ||
288 | QIconViewItem* _it = m_view->currentItem(); | ||
289 | if ( !_it ) | ||
290 | return QString::null; | ||
291 | _it = _it->prevItem(); | ||
292 | if ( !_it ) | ||
293 | return QString::null; | ||
294 | IconViewItem* it = static_cast<IconViewItem*>( _it ); | ||
295 | isDir = it->isDir(); | ||
296 | m_view->setCurrentItem(_it); | ||
297 | return it->path(); | ||
298 | } | ||
299 | |||
271 | void PIconView::slotTrash() { | 300 | void PIconView::slotTrash() { |
272 | bool isDir; | 301 | bool isDir; |
273 | QString pa = currentFileName( isDir ); | 302 | QString pa = currentFileName( isDir ); |
@@ -446,6 +475,25 @@ void PIconView::slotEnd() { | |||
446 | m_updatet = false; | 475 | m_updatet = false; |
447 | } | 476 | } |
448 | 477 | ||
478 | void PIconView::slotShowNext() | ||
479 | { | ||
480 | bool isDir = false; | ||
481 | QString name = nextFileName(isDir); | ||
482 | if (isDir) return; | ||
483 | if (name.isEmpty()) return; | ||
484 | odebug << "Show next: " << name << oendl; | ||
485 | slotShowImage(name); | ||
486 | } | ||
487 | |||
488 | void PIconView::slotShowPrev() | ||
489 | { | ||
490 | bool isDir = false; | ||
491 | QString name = prevFileName(isDir); | ||
492 | if (isDir) return; | ||
493 | if (name.isEmpty()) return; | ||
494 | slotShowImage(name); | ||
495 | } | ||
496 | |||
449 | void PIconView::slotShowImage() | 497 | void PIconView::slotShowImage() |
450 | { | 498 | { |
451 | bool isDir = false; | 499 | bool isDir = false; |