[f-spot: 13/16] Choose the latest available version as the default one after deletion.



commit a635a42152074c1333403a0726ff85516330d9f4
Author: Anton Keks <anton azib net>
Date:   Mon Aug 3 21:30:35 2009 +0300

    Choose the latest available version as the default one after deletion.
    
    It doesn't make sense to select Original, if there are more versions.

 src/Core/Photo.cs |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Photo.cs b/src/Core/Photo.cs
index 3a8c6a5..aa5adf6 100644
--- a/src/Core/Photo.cs
+++ b/src/Core/Photo.cs
@@ -304,13 +304,12 @@ namespace FSpot
 
 			changes.RemoveVersion (version_id);
 
-			do {
-				version_id --;
+			for (version_id = highest_version_id; version_id >= OriginalVersionId; version_id--) {
 				if (versions.ContainsKey (version_id)) {
 					DefaultVersionId = version_id;
 					break;
 				}
-			} while (version_id > OriginalVersionId);
+			}
 		}
 
 		public uint CreateVersion (string name, uint base_version_id, bool create)



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