diff options
author | Matt Ward <matt.ward@xamarin.com> | 2015-09-12 12:37:40 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@xamarin.com> | 2015-09-12 12:52:05 +0300 |
commit | 70f425eea058aab614fa46204a98125c388cf403 (patch) | |
tree | ea57fc9135f46607ea810905c68916dcf713bcc2 /main/src/core/MonoDevelop.Ide | |
parent | aa9ee836c462c7fe9fe1d62207bc0ca77d8fde0b (diff) |
[Ide] Fix categories being removed with multiple template providers.
With two project template providers, where the second provider has its
own template category, this template category would be removed when
the first project template providers templates were categorized. This
would mean the project template would never be displayed since even
the default category would be removed since it was empty on the first
categorization of the project templates.
Now the removing of the empty project categories is done after all
templates are categorized. This prevents categories being removed too
soon before all template providers have provided their templates.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs index cb0e0ebf53..1742eb86ec 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs @@ -37,6 +37,7 @@ namespace MonoDevelop.Ide.Templates TemplateCategory defaultCategory;
Dictionary<string, TemplateCategory> mappedCategories = new Dictionary<string, TemplateCategory> ();
Predicate<SolutionTemplate> templateMatch;
+ bool removedEmptyCategories;
public static readonly Predicate<SolutionTemplate> MatchNewProjectTemplates = template => template.IsMatch (SolutionTemplateVisibility.NewProject);
public static readonly Predicate<SolutionTemplate> MatchNewSolutionTemplates = template => template.IsMatch (SolutionTemplateVisibility.NewSolution);
@@ -86,6 +87,11 @@ namespace MonoDevelop.Ide.Templates public IEnumerable<TemplateCategory> GetCategorizedTemplates ()
{
+ if (!removedEmptyCategories) {
+ RemoveEmptyCategories ();
+ removedEmptyCategories = true;
+ }
+
return categories;
}
@@ -99,7 +105,6 @@ namespace MonoDevelop.Ide.Templates LogNoCategoryMatch (template);
}
}
- RemoveEmptyCategories ();
}
IEnumerable<SolutionTemplate> GetFilteredTemplates (IEnumerable<SolutionTemplate> templates)
|