[f-spot] Skip missing photos in slideshow



commit 073a80c041a3ad6e0e737ae09f299a09f208f976
Author: Anton Keks <anton azib net>
Date:   Wed May 19 23:57:36 2010 +0300

    Skip missing photos in slideshow
    
    But make at most 10 retries each time to avoid infinite loop.

 src/Widgets/SlideShow.cs |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/Widgets/SlideShow.cs b/src/Widgets/SlideShow.cs
index 6e30196..5225c68 100644
--- a/src/Widgets/SlideShow.cs
+++ b/src/Widgets/SlideShow.cs
@@ -22,6 +22,7 @@ namespace FSpot.Widgets
 	{
 		bool running;
 		BrowsablePointer item;
+		int loadRetries = 0;
 #region Public API
 
 		public SlideShow (BrowsablePointer item) : this (item, 6000, false)
@@ -125,8 +126,13 @@ namespace FSpot.Widgets
 						Cms.Profile screen_profile;
 						if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_DISPLAY_PROFILE), out screen_profile)) 
 							FSpot.ColorManagement.ApplyProfile (next, screen_profile);
+						loadRetries = 0;
 					} catch (Exception) {
 						next = PixbufUtils.ErrorPixbuf;
+						if (++loadRetries < 10)
+							item.MoveNext (true);
+						else
+							loadRetries = 0;
 					}
 				}
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]