1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Another NPE in build console fixed + cleanup wizard

This commit is contained in:
Andrew Gvozdev 2010-03-15 16:28:05 +00:00
parent 6d9cc48125
commit 0c0bb08f51

View file

@ -27,9 +27,9 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.action.GroupMarker;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
@ -163,17 +163,19 @@ public class BuildConsolePage extends Page
protected void setProject(IProject project) {
if (fProject != project && project.isAccessible()) {
fProject = project;
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
fSaveConsoleAction.setChecked(false);
ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
// Read save console log preferences
try {
IEclipsePreferences pref = new InstanceScope().getNode(CCorePlugin.PLUGIN_ID);
boolean b = pref.getBoolean(BuildOutputLogger.getIsSavingKey(project, configDesc.getName()),false);
fSaveConsoleAction.setChecked(b);
} catch (Exception e) {
CUIPlugin.log(e);
if (projDesc!=null) {
fProject = project;
fSaveConsoleAction.setChecked(false);
ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
// Read save console log preferences
try {
IEclipsePreferences pref = new InstanceScope().getNode(CCorePlugin.PLUGIN_ID);
boolean b = pref.getBoolean(BuildOutputLogger.getIsSavingKey(project, configDesc.getName()),false);
fSaveConsoleAction.setChecked(b);
} catch (Exception e) {
CUIPlugin.log(e);
}
}
}
}