Browse Source

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.
4.1
Daniel Grunwald 15 years ago
parent
commit
6fc1d200d4
  1. 2
      src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs
  2. 12
      src/Main/Base/Project/Src/Project/Solution/Solution.cs

2
src/Main/Base/Project/Src/Gui/Dialogs/SolutionConfiguration/EditAvailableConfigurationsDialog.cs

@ -220,7 +220,7 @@ namespace ICSharpCode.SharpDevelop.Gui
IProjectAllowChangeConfigurations pacc = project as IProjectAllowChangeConfigurations; IProjectAllowChangeConfigurations pacc = project as IProjectAllowChangeConfigurations;
if (pacc != null) { if (pacc != null) {
if (editPlatforms) { if (editPlatforms) {
pacc.AddProjectPlatform(newName, dlg.CopyFrom); pacc.AddProjectPlatform(MSBuildInternals.FixPlatformNameForProject(newName), dlg.CopyFrom);
} else { } else {
pacc.AddProjectConfiguration(newName, dlg.CopyFrom); pacc.AddProjectConfiguration(newName, dlg.CopyFrom);
} }

12
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -359,11 +359,14 @@ namespace ICSharpCode.SharpDevelop.Project
SaveProjectSections(folder.Sections, projectSection); 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--) { for (int i = folder.Folders.Count - 1; i >= 0; i--) {
//foreach (ISolutionFolder subFolder in folder.Folders) { stack.Push(folder.Folders[i]);
subFolder = folder.Folders[i]; }
stack.Push(subFolder); // 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("\t\t");
nestedProjectsSection.Append(subFolder.IdGuid); nestedProjectsSection.Append(subFolder.IdGuid);
nestedProjectsSection.Append(" = "); nestedProjectsSection.Append(" = ");
@ -1191,6 +1194,7 @@ namespace ICSharpCode.SharpDevelop.Project
#region System.IDisposable interface implementation #region System.IDisposable interface implementation
public void Dispose() public void Dispose()
{ {
changeWatcher.Dispose();
foreach (IProject project in Projects) { foreach (IProject project in Projects) {
project.Dispose(); project.Dispose();
} }

Loading…
Cancel
Save