1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

save the preference when shutting down

This commit is contained in:
Alain Magloire 2004-09-11 03:58:23 +00:00
parent fd19cbc055
commit c7b33d247f
3 changed files with 11 additions and 12 deletions

View file

@ -183,6 +183,7 @@ public class MakeCorePlugin extends Plugin {
fDiscoveryPathManager.shutdown(); fDiscoveryPathManager.shutdown();
fDiscoveryPathManager = null; fDiscoveryPathManager = null;
} }
savePluginPreferences();
} finally { } finally {
super.stop(context); super.stop(context);
} }

View file

@ -25,6 +25,7 @@ import java.util.StringTokenizer;
import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.makefile.IDirective; import org.eclipse.cdt.make.core.makefile.IDirective;
import org.eclipse.cdt.make.core.makefile.IMakefile;
import org.eclipse.cdt.make.core.makefile.gnu.IGNUMakefile; import org.eclipse.cdt.make.core.makefile.gnu.IGNUMakefile;
import org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile; import org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile;
import org.eclipse.cdt.make.internal.core.makefile.BadDirective; import org.eclipse.cdt.make.internal.core.makefile.BadDirective;
@ -775,7 +776,11 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
for (int i = 0; i < dirs.length; ++i) { for (int i = 0; i < dirs.length; ++i) {
if (dirs[i] instanceof Include) { if (dirs[i] instanceof Include) {
Include include = (Include)dirs[i]; Include include = (Include)dirs[i];
list.addAll(Arrays.asList(include.getDirectives())); IDirective[] includedMakefiles = include.getDirectives();
for (int j = 0; j < includedMakefiles.length; ++j) {
IMakefile includedMakefile = (IMakefile)includedMakefiles[j];
list.addAll(Arrays.asList(includedMakefile.getDirectives()));
}
} }
} }
return (IDirective[]) list.toArray(new IDirective[list.size()]); return (IDirective[]) list.toArray(new IDirective[list.size()]);

View file

@ -41,17 +41,13 @@ public class Include extends Parent implements IInclude {
} }
public IDirective[] getDirectives() { public IDirective[] getDirectives() {
GNUMakefile gnu = new GNUMakefile();
clearDirectives(); clearDirectives();
for (int i = 0; i < filenames.length; i++) { for (int i = 0; i < filenames.length; i++) {
// Try the current directory. // Try the current directory.
GNUMakefile gnu = new GNUMakefile();
try { try {
gnu.parse(filenames[i]); gnu.parse(filenames[i]);
Directive[] subdirs = gnu.getStatements(); addDirective(gnu);
addDirectives(subdirs);
for (int k = 0; k < subdirs.length; ++k) {
subdirs[k].setFilename(filenames[i]);
}
continue; continue;
} catch (IOException e) { } catch (IOException e) {
} }
@ -59,12 +55,9 @@ public class Include extends Parent implements IInclude {
for (int j = 0; j < dirs.length; j++) { for (int j = 0; j < dirs.length; j++) {
try { try {
String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i]; String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i];
gnu = new GNUMakefile();
gnu.parse(filename); gnu.parse(filename);
Directive[] subdirs = gnu.getStatements(); addDirective(gnu);
addDirectives(subdirs);
for (int k = 0; k < subdirs.length; ++k) {
subdirs[k].setFilename(filename);
}
break; break;
} catch (IOException e) { } catch (IOException e) {
} }