1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-14 03:35:37 +02:00

fixed validity checking

This commit is contained in:
David Inglis 2002-08-13 20:39:07 +00:00
parent 7d0d12f449
commit d71e4b162d

View file

@ -282,11 +282,13 @@ public class CMainTab extends CLaunchConfigurationTab {
setMessage(null); setMessage(null);
String name = fProjText.getText().trim(); String name = fProjText.getText().trim();
if (name.length() > 0) { if (name.length() == 0) {
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) { setErrorMessage("Project not specified");
setErrorMessage("Project does not exist"); return false;
return false; }
} if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
setErrorMessage("Project does not exist");
return false;
} }
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
@ -295,10 +297,7 @@ public class CMainTab extends CLaunchConfigurationTab {
setErrorMessage("Program not specified"); setErrorMessage("Program not specified");
return false; return false;
} }
IPath path = Platform.getLocation().append(project.getFullPath()); if (!project.getFile(name).exists() ) {
path = path.append(name);
if (!ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path).exists()) {
setErrorMessage("Program does not exist"); setErrorMessage("Program does not exist");
return false; return false;
} }