mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-19 23:15:24 +02:00
Check if it was already enabled.
This commit is contained in:
parent
5e27de87ed
commit
0f475ccc84
1 changed files with 9 additions and 6 deletions
|
@ -33,16 +33,19 @@ public class IndexModel {
|
|||
}
|
||||
|
||||
public void setEnabled(IProject project, boolean on) {
|
||||
String prop = new Boolean(on).toString();
|
||||
try {
|
||||
if (project != null) {
|
||||
project.setPersistentProperty(activationKey, prop);
|
||||
Boolean newValue = new Boolean(on);
|
||||
Boolean oldValue = new Boolean(isEnabled(project));
|
||||
if (!oldValue.equals(newValue)) {
|
||||
project.setPersistentProperty(activationKey, newValue.toString());
|
||||
if (on) {
|
||||
addResource(project);
|
||||
} else {
|
||||
removeResource(project);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue