mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 18:05:33 +02:00
fixed validity checking
This commit is contained in:
parent
7d0d12f449
commit
d71e4b162d
1 changed files with 8 additions and 9 deletions
|
@ -282,11 +282,13 @@ public class CMainTab extends CLaunchConfigurationTab {
|
|||
setMessage(null);
|
||||
|
||||
String name = fProjText.getText().trim();
|
||||
if (name.length() > 0) {
|
||||
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
||||
setErrorMessage("Project does not exist");
|
||||
return false;
|
||||
}
|
||||
if (name.length() == 0) {
|
||||
setErrorMessage("Project not specified");
|
||||
return false;
|
||||
}
|
||||
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
|
||||
setErrorMessage("Project does not exist");
|
||||
return false;
|
||||
}
|
||||
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
|
||||
|
||||
|
@ -295,10 +297,7 @@ public class CMainTab extends CLaunchConfigurationTab {
|
|||
setErrorMessage("Program not specified");
|
||||
return false;
|
||||
}
|
||||
IPath path = Platform.getLocation().append(project.getFullPath());
|
||||
path = path.append(name);
|
||||
|
||||
if (!ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path).exists()) {
|
||||
if (!project.getFile(name).exists() ) {
|
||||
setErrorMessage("Program does not exist");
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue