[mistelix] Fixes issue #589664



commit 78c772278b53e4ce5d13774b50c795a352a5c136
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Jul 25 20:59:27 2009 +0200

    Fixes issue #589664

 src/core/RecentFilesStorage.cs |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/core/RecentFilesStorage.cs b/src/core/RecentFilesStorage.cs
index 582e308..3b52977 100644
--- a/src/core/RecentFilesStorage.cs
+++ b/src/core/RecentFilesStorage.cs
@@ -94,13 +94,13 @@ namespace Mistelix.Core
 			item = new RecentFile (filename);
 
 			if (items.Count >= MAX_ITEMS) {
-				DateTime timestamp;
-				int older = -1;
+				DateTime timestamp = items[0].timestamp;
+				int older = 0;
 
 				// Remove the older item
-				for (int i = 0; i < Items.Count; i++)
+				for (int i = 1; i < Items.Count; i++)
 				{
-					if (i == 0 || items[i].timestamp < timestamp) {
+					if (items[i].timestamp < timestamp) {
 						timestamp = items[i].timestamp;
 						older = i;
 					}
@@ -120,10 +120,8 @@ namespace Mistelix.Core
 				return;
 
 			XmlStorage ps = new XmlStorage ();
-			ps.Load (filename);
-
 			XmlNode root;
-			string from_node = RECENT_TAG;
+			ps.Load (filename);
 
 			if ((ps.xml_document.ChildNodes.Count > 0) == false)
 				return;



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