[haiku-commits] haiku: hrev53333 - src/apps/showimage

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 2 Aug 2019 21:29:06 -0400 (EDT)

hrev53333 adds 1 changeset to branch 'master'
old head: 677e901f80dcaf6f835603825029f8bc5fbd12f7
new head: 47df2afbf848b56bd873a4b4f201b49b8080cdf8
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=47df2afbf848+%5E677e901f80dc

----------------------------------------------------------------------------

47df2afbf848: ShowImage: Wrap to first image when going next on last image
  
  I find this handy and in addition it makes the slide show cyclic again,
  fixing #10386.
  
  Going the other way might also be useful, but that requires some additions to
  the Navigator code first.

                                  [ Ryan Leavengood <leavengood@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev53333
Commit:      47df2afbf848b56bd873a4b4f201b49b8080cdf8
URL:         https://git.haiku-os.org/haiku/commit/?id=47df2afbf848
Author:      Ryan Leavengood <leavengood@xxxxxxxxx>
Date:        Sat Aug  3 01:24:23 2019 UTC

Ticket:      https://dev.haiku-os.org/ticket/10386

----------------------------------------------------------------------------

1 file changed, 6 insertions(+), 1 deletion(-)
src/apps/showimage/ShowImageWindow.cpp | 7 ++++++-

----------------------------------------------------------------------------

diff --git a/src/apps/showimage/ShowImageWindow.cpp 
b/src/apps/showimage/ShowImageWindow.cpp
index 10f0deee51..724b4ff798 100644
--- a/src/apps/showimage/ShowImageWindow.cpp
+++ b/src/apps/showimage/ShowImageWindow.cpp
@@ -846,8 +846,13 @@ ShowImageWindow::MessageReceived(BMessage* message)
 
                case MSG_FILE_NEXT:
                case kMsgNextSlide:
-                       if (_ClosePrompt() && fNavigator.NextFile())
+                       if (_ClosePrompt()) {
+                               if (!fNavigator.NextFile()) {
+                                       // Wrap back around
+                                       fNavigator.FirstFile();
+                               }
                                _LoadImage();
+                       }
                        break;
 
                case kMsgDeleteCurrentFile:


Other related posts:

  • » [haiku-commits] haiku: hrev53333 - src/apps/showimage - Ryan Leavengood