From ca5cf5037e46fcfc72b431cfa6db7c4e39f5340c Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 15 Mar 2017 11:26:00 +0000 Subject: [PATCH] CP-21174: Multiple dismissed XenCenterVersion alerts - Limit the size of the list where we keep the dismissed XenCenter version alerts Signed-off-by: Mihaela Stoica --- XenAdmin/Alerts/Types/XenCenterUpdateAlert.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/XenAdmin/Alerts/Types/XenCenterUpdateAlert.cs b/XenAdmin/Alerts/Types/XenCenterUpdateAlert.cs index e1a9d1019..0f76904de 100644 --- a/XenAdmin/Alerts/Types/XenCenterUpdateAlert.cs +++ b/XenAdmin/Alerts/Types/XenCenterUpdateAlert.cs @@ -101,11 +101,15 @@ namespace XenAdmin.Alerts } } + static int DISMISSED_XC_VERSIONS_LIMIT = 5; + public override void Dismiss() { List current = new List(Properties.Settings.Default.LatestXenCenterSeen.Split(',')); if (current.Contains(NewVersion.VersionAndLang)) return; + if (current.Count >= DISMISSED_XC_VERSIONS_LIMIT) + current.RemoveRange(0, current.Count - DISMISSED_XC_VERSIONS_LIMIT + 1); current.Add(NewVersion.VersionAndLang); Properties.Settings.Default.LatestXenCenterSeen = string.Join(",", current.ToArray()); Settings.TrySaveSettings();