From 6fc1d200d484c0c8cfdad8c8df5821ecb4fc7203 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 27 Aug 2011 00:24:05 +0200 Subject: [PATCH] Dispose ProjectChangeWatcher when solution is disposed. Fixed adding 'AnyCPU' platform to a single project using the configuration editor. Save "GlobalSection(NestedProjects)" in the correct order - SharpDevelop was saving it in the opposite order of the "Project"-sections. This was the cause of the whole .sln-file getting rearranged on every change, making merging .sln changes difficult. Note that fixed SharpDevelop version will rearrange the solution one last time if the "NestedProjects" global section specifies a different order than the "Project"-sections. --- .../EditAvailableConfigurationsDialog.cs | 2 +- .../Base/Project/Src/Project/Solution/Solution.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs index 36973dc833..6bc98452b3 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs @@ -220,7 +220,7 @@ namespace ICSharpCode.SharpDevelop.Gui IProjectAllowChangeConfigurations pacc = project as IProjectAllowChangeConfigurations; if (pacc != null) { if (editPlatforms) { - pacc.AddProjectPlatform(newName, dlg.CopyFrom); + pacc.AddProjectPlatform(MSBuildInternals.FixPlatformNameForProject(newName), dlg.CopyFrom); } else { pacc.AddProjectConfiguration(newName, dlg.CopyFrom); } diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index 6e397913d1..9963e3b8c9 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -359,11 +359,14 @@ namespace ICSharpCode.SharpDevelop.Project SaveProjectSections(folder.Sections, projectSection); - ISolutionFolder subFolder; + // Push the sub folders in reverse order so that we pop them + // in the correct order. for (int i = folder.Folders.Count - 1; i >= 0; i--) { - //foreach (ISolutionFolder subFolder in folder.Folders) { - subFolder = folder.Folders[i]; - stack.Push(subFolder); + stack.Push(folder.Folders[i]); + } + // But use normal order for printing the nested projects section + for (int i = 0; i < folder.Folders.Count; i++) { + ISolutionFolder subFolder = folder.Folders[i]; nestedProjectsSection.Append("\t\t"); nestedProjectsSection.Append(subFolder.IdGuid); nestedProjectsSection.Append(" = "); @@ -1191,6 +1194,7 @@ namespace ICSharpCode.SharpDevelop.Project #region System.IDisposable interface implementation public void Dispose() { + changeWatcher.Dispose(); foreach (IProject project in Projects) { project.Dispose(); }