From bded31e7fb8b02133ced00713693fa9b10ab7d7a Mon Sep 17 00:00:00 2001 From: Oleg Krasilnikov Date: Tue, 22 May 2007 11:49:20 +0000 Subject: [PATCH] Bug #188285 : deletes src-code when cancelled. --- .../org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java | 6 ++++-- .../src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java index b1b7cc1eadd..e0e226fceeb 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTCommonProjectWizard.java @@ -117,8 +117,10 @@ implements IExecutableExtension, IWizardWithMemory if (newProject == null) { existingPath = false; IPath p = fMainPage.getProjectLocation(); - if (p == null) p = ResourcesPlugin.getWorkspace().getRoot().getLocation(); - p = p.append(fMainPage.getProjectName()); + if (p == null) { + p = ResourcesPlugin.getWorkspace().getRoot().getLocation(); + p = p.append(fMainPage.getProjectName()); + } File f = p.toFile(); if (f.exists() && f.isDirectory()) { if (p.append(".project").toFile().exists()) { //$NON-NLS-1$ diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java index 7bc7503a674..54f4e2c860c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/CDTMainWizardPage.java @@ -344,8 +344,11 @@ import org.eclipse.cdt.internal.ui.CPluginImages; if (bad) { // skip this check if project already created IPath p = getProjectLocation(); - if (p == null) p = ResourcesPlugin.getWorkspace().getRoot().getLocation(); - File f = p.append(getProjectName()).toFile(); + if (p == null) { + p = ResourcesPlugin.getWorkspace().getRoot().getLocation(); + p = p.append(getProjectName()); + } + File f = p.toFile(); if (f.exists()) { if (f.isDirectory()) { setErrorMessage(UIMessages.getString("CMainWizardPage.7")); //$NON-NLS-1$