From f1a4d0ae90e105105725c7134adf7e2d070d5524 Mon Sep 17 00:00:00 2001 From: David Inglis Date: Thu, 21 Aug 2003 19:43:47 +0000 Subject: [PATCH] - fixed problem with convert wizard with closed projects - added .cdtproject convertion --- .../make/ui/actions/UpdateMakeProjectAction.java | 13 +++++++++---- .../ui/wizards/UpdateMakeProjectWizardPage.java | 14 ++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java index fc958da44aa..02907c82f61 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/UpdateMakeProjectAction.java @@ -29,7 +29,6 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ISelection; @@ -66,13 +65,12 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate { project = ((ICProject) elem).getProject(); } if (project != null) { + projects.add(project); } } final IProject[] projectArray = (IProject[]) projects.toArray(new IProject[projects.size()]); - ProgressMonitorDialog pd = new ProgressMonitorDialog(MakeUIPlugin.getActiveWorkbenchShell()); - run(true, pd, projectArray); UpdateMakeProjectWizard wizard = new UpdateMakeProjectWizard(projectArray); WizardDialog dialog = new WizardDialog(MakeUIPlugin.getActiveWorkbenchShell(), wizard); dialog.open(); @@ -114,12 +112,19 @@ public class UpdateMakeProjectAction implements IWorkbenchWindowActionDelegate { project[i], MakeCorePlugin.OLD_BUILDER_ID, new SubProgressMonitor(monitor, 1)); + + // convert .cdtproject + CCorePlugin.getDefault().mapCProjectOwner(project[i], MakeCorePlugin.getUniqueIdentifier() + ".make", true); // add new nature MakeProjectNature.addNature(project[i], new SubProgressMonitor(monitor, 1)); + + // move existing build properties to new IMakeBuilderInfo newInfo = MakeCorePlugin.createBuildInfo(project[i], MakeBuilder.BUILDER_ID); QualifiedName qlocation = new QualifiedName(CCorePlugin.PLUGIN_ID, "buildLocation"); String location = project[i].getPersistentProperty(qlocation); - newInfo.setBuildCommand(new Path(location)); + if ( location != null) { + newInfo.setBuildCommand(new Path(location)); + } //remove old properties QualifiedName[] qName = diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java index 40ea79e9628..7fe625ac5e7 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/wizards/UpdateMakeProjectWizardPage.java @@ -117,12 +117,14 @@ public class UpdateMakeProjectWizardPage extends StatusWizardPage { Vector result = new Vector(); try { for (int i = 0; i < project.length; i++) { - IProjectDescription desc = project[i].getDescription(); - ICommand builder[] = desc.getBuildSpec(); - for( int j = 0; j < builder.length; j++ ) { - if (builder[j].getBuilderName().equals(MakeCorePlugin.OLD_BUILDER_ID)) { - result.add(project[i]); - break; + if (project[i].isAccessible()) { + IProjectDescription desc = project[i].getDescription(); + ICommand builder[] = desc.getBuildSpec(); + for (int j = 0; j < builder.length; j++) { + if (builder[j].getBuilderName().equals(MakeCorePlugin.OLD_BUILDER_ID)) { + result.add(project[i]); + break; + } } } }