mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
fixed validity checking
This commit is contained in:
parent
7d0d12f449
commit
d71e4b162d
1 changed files with 8 additions and 9 deletions
|
@ -282,12 +282,14 @@ 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) {
|
||||||
|
setErrorMessage("Project not specified");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
||||||
setErrorMessage("Project does not exist");
|
setErrorMessage("Project does not exist");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
||||||
|
|
||||||
name = fProgText.getText().trim();
|
name = fProgText.getText().trim();
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue