public override IEnumerable <DesktopApplication> GetApplications(string filename) { //FIXME: we should disambiguate dupliacte apps in different locations and display both //for now, just filter out the duplicates var checkUniqueName = new HashSet <string> (); var checkUniquePath = new HashSet <string> (); //FIXME: bundle path is wrong because of how MD is built into an app //var thisPath = NSBundle.MainBundle.BundleUrl.Path; //checkUniquePath.Add (thisPath); checkUniqueName.Add("MonoDevelop"); checkUniqueName.Add(BrandingService.ApplicationName); string def = CoreFoundation.GetApplicationUrl(filename, CoreFoundation.LSRolesMask.All); var apps = new List <DesktopApplication> (); foreach (var app in CoreFoundation.GetApplicationUrls(filename, CoreFoundation.LSRolesMask.All)) { if (string.IsNullOrEmpty(app) || !checkUniquePath.Add(app)) { continue; } var name = NSFileManager.DefaultManager.DisplayName(app); if (checkUniqueName.Add(name)) { apps.Add(new MacDesktopApplication(app, name, def != null && def == app)); } } apps.Sort((DesktopApplication a, DesktopApplication b) => { int r = a.IsDefault.CompareTo(b.IsDefault); if (r != 0) { return(-r); } return(a.DisplayName.CompareTo(b.DisplayName)); }); return(apps); }