1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 10:46:02 +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.CoreException;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences; 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.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; 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.GroupMarker;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuListener;
@ -163,17 +163,19 @@ public class BuildConsolePage extends Page
protected void setProject(IProject project) { protected void setProject(IProject project) {
if (fProject != project && project.isAccessible()) { if (fProject != project && project.isAccessible()) {
fProject = project;
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project); ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project);
fSaveConsoleAction.setChecked(false); if (projDesc!=null) {
ICConfigurationDescription configDesc = projDesc.getActiveConfiguration(); fProject = project;
// Read save console log preferences fSaveConsoleAction.setChecked(false);
try { ICConfigurationDescription configDesc = projDesc.getActiveConfiguration();
IEclipsePreferences pref = new InstanceScope().getNode(CCorePlugin.PLUGIN_ID); // Read save console log preferences
boolean b = pref.getBoolean(BuildOutputLogger.getIsSavingKey(project, configDesc.getName()),false); try {
fSaveConsoleAction.setChecked(b); IEclipsePreferences pref = new InstanceScope().getNode(CCorePlugin.PLUGIN_ID);
} catch (Exception e) { boolean b = pref.getBoolean(BuildOutputLogger.getIsSavingKey(project, configDesc.getName()),false);
CUIPlugin.log(e); fSaveConsoleAction.setChecked(b);
} catch (Exception e) {
CUIPlugin.log(e);
}
} }
} }
} }