# HG changeset patch # User timkelly # Date 1249933548 18000 # Node ID 23528f18d3fd5227fba0287cce1bb3239f9e2abf # Parent d0373668f9ffaa682cc77f1fc1c2e63cf9ef4b8e# Parent 5354388b2a6b6528de5692762c3d83362d3b7f92 merge commit diff -r 5354388b2a6b -r 23528f18d3fd builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/BuildConfigurationData.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/BuildConfigurationData.java Mon Aug 10 12:23:55 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/BuildConfigurationData.java Mon Aug 10 14:45:48 2009 -0500 @@ -42,6 +42,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; +import org.eclipse.swt.widgets.Display; import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; import com.nokia.carbide.cdt.builder.EpocEngineHelper; @@ -269,12 +270,12 @@ private void persistCache() { // persist the cache between IDE launches. try { - ICarbideProjectInfo cpi = carbideBuildConfig.getCarbideProject(); + final ICarbideProjectInfo cpi = carbideBuildConfig.getCarbideProject(); if (cpi == null) { return; } - ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(cpi.getProject()); + ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(cpi.getProject(), false); if (projDes != null) { ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getDisplayString()); if (configDes != null) { @@ -292,8 +293,17 @@ } storage.setAttribute(FILES_CACHE, filesCacheValue); - // save the CDT project description - CCorePlugin.getDefault().setProjectDescription(cpi.getProject(), projDes, true, new NullProgressMonitor()); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(cpi.getProject()); + try { + // save the CDT project description + CCorePlugin.getDefault().setProjectDescription(cpi.getProject(), projDes, true, new NullProgressMonitor()); + } catch (CoreException e) { + CarbideBuilderPlugin.log(e); + } + } + }); } } } catch (CoreException e) { diff -r 5354388b2a6b -r 23528f18d3fd builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Aug 10 12:23:55 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideLanguageData.java Mon Aug 10 14:45:48 2009 -0500 @@ -27,6 +27,7 @@ import org.eclipse.core.resources.ProjectScope; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.content.*; +import org.eclipse.swt.widgets.Display; import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; import com.nokia.carbide.cdt.builder.EpocEngineHelper; @@ -309,8 +310,8 @@ private void persistCache() { // persist the cache between IDE launches. try { - IProject project = carbideBuildConfig.getCarbideProject().getProject(); - ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); + final IProject project = carbideBuildConfig.getCarbideProject().getProject(); + ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project, false); if (projDes != null) { ICConfigurationDescription configDes = projDes.getConfigurationById(carbideBuildConfig.getDisplayString()); if (configDes != null) { @@ -344,8 +345,17 @@ } storage.setAttribute(FILES_CACHE, filesCacheValue); - // save the CDT project description - CCorePlugin.getDefault().setProjectDescription(project, projDes, true, new NullProgressMonitor()); + Display.getDefault().asyncExec(new Runnable() { + public void run() { + ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); + try { + // save the CDT project description + CCorePlugin.getDefault().setProjectDescription(project, projDes, true, new NullProgressMonitor()); + } catch (CoreException e) { + CarbideBuilderPlugin.log(e); + } + } + }); } } } catch (CoreException e) { diff -r 5354388b2a6b -r 23528f18d3fd builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectInfo.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectInfo.java Mon Aug 10 12:23:55 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectInfo.java Mon Aug 10 14:45:48 2009 -0500 @@ -83,9 +83,9 @@ this.projectTracker = new TrackedResource(project); try { - ICProjectDescription projDes = getProjectDescription(); + ICProjectDescription projDes = getProjectDescription(false); if (projDes != null) { - initializeDefaults(projDes); + initializeDefaults(); ICStorageElement storage = projDes.getStorage(CarbideBuilderPlugin.getCarbideBuilderExtensionID(), false); if (storage != null) { @@ -232,7 +232,7 @@ } } - protected void initializeDefaults(ICProjectDescription projDes) { + protected void initializeDefaults() { overrideWorkspaceSettings = false; if (CarbideBuilderPlugin.getBuildManager().isCarbideSBSv2Project(projectTracker.getProject())) { @@ -260,7 +260,7 @@ List configs = new ArrayList(); - ICProjectDescription projectDescription = getProjectDescription(); + ICProjectDescription projectDescription = getProjectDescription(false); if (projectDescription != null) { for (ICConfigurationDescription config : projectDescription.getConfigurations()) { CConfigurationData data = config.getConfigurationData(); @@ -274,7 +274,7 @@ } public ICarbideBuildConfiguration getNamedConfiguration(String configName) { - ICProjectDescription projectDescription = getProjectDescription(); + ICProjectDescription projectDescription = getProjectDescription(false); if (projectDescription != null) { ICConfigurationDescription config = projectDescription.getConfigurationByName(configName); if (config != null) { @@ -289,7 +289,7 @@ } public ICarbideBuildConfiguration getDefaultConfiguration() { - ICProjectDescription projectDescription = getProjectDescription(); + ICProjectDescription projectDescription = getProjectDescription(false); if (projectDescription == null) return null; ICConfigurationDescription config = projectDescription.getActiveConfiguration(); @@ -412,8 +412,8 @@ return workingDir; } - protected ICProjectDescription getProjectDescription() { - return CoreModel.getDefault().getProjectDescription(projectTracker.getProject()); + protected ICProjectDescription getProjectDescription(boolean writable) { + return CoreModel.getDefault().getProjectDescription(projectTracker.getProject(), writable); } public int getCleanLevel() { diff -r 5354388b2a6b -r 23528f18d3fd builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectModifier.java --- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectModifier.java Mon Aug 10 12:23:55 2009 -0500 +++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/internal/builder/CarbideProjectModifier.java Mon Aug 10 14:45:48 2009 -0500 @@ -45,7 +45,7 @@ super(projDes.getProject()); this.projDes = projDes; - initializeDefaults(projDes); + initializeDefaults(); } /* @@ -56,7 +56,7 @@ // get the latest ICProjectDescription super(cpi.projectTracker.getProject()); - projDes = getProjectDescription(); + projDes = getProjectDescription(true); projectRelativeBldInfPath = cpi.projectRelativeBldInfPath; buildFromInf = cpi.buildFromInf; overrideWorkspaceSettings = cpi.overrideWorkspaceSettings;