diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2011-04-04 21:35:45 +0400 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2011-04-04 21:35:45 +0400 |
commit | d71ab8378c703aacaa12d8e58f3b42498e58ae04 (patch) | |
tree | 7df1b482212101e81431159d07ed7706553038c7 /Mono.Addins.Gui | |
parent | 75b002e8898deadc4aa38105b10eaece5150ecaa (diff) |
Fix update command when invoked from the installed add-ins list
Diffstat (limited to 'Mono.Addins.Gui')
-rw-r--r-- | Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs b/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs index c1e1bfe..10ccb9f 100644 --- a/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs +++ b/Mono.Addins.Gui/Mono.Addins.Gui/AddinInfoView.cs @@ -193,8 +193,11 @@ namespace Mono.Addins.Gui if (data is Addin) { installed = (Addin) data; sinfo = SetupService.GetAddinHeader (installed); - updateInfo = GetUpdate (installed); - selectedEntry.Clear (); + var entry = GetUpdate (installed); + if (entry != null) { + updateInfo = entry.Addin; + selectedEntry.Add (entry); + } foreach (var prop in sinfo.Properties) { if (prop.Name.StartsWith ("PreviewImage")) previewImages.Add (new ImageContainer (installed, prop.Value)); @@ -315,14 +318,14 @@ namespace Mono.Addins.Gui } } - public AddinHeader GetUpdate (Addin a) + public AddinRepositoryEntry GetUpdate (Addin a) { AddinRepositoryEntry[] updates = service.Repositories.GetAvailableAddinUpdates (Addin.GetIdName (a.Id)); - AddinHeader best = null; + AddinRepositoryEntry best = null; string bestVersion = a.Version; foreach (AddinRepositoryEntry e in updates) { if (Addin.CompareVersions (bestVersion, e.Addin.Version) > 0) { - best = e.Addin; + best = e; bestVersion = e.Addin.Version; } } |