[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] ICDescriptor.saveProjectData() doesn't always serializeto .cproject
|
Hi1
I came across similar problems in one case where I tried to save a
project description. Possible reasons where saving does not work:
- You make those calls within a job, and the job has a rule other than
workspace root (however, without rule it works). This gives an exception
that is swallowed by CDT without any message. See also bug #198523.
- The .cproject file is writable. In this case an exception is thrown.
Best regards,
Gerhard
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jason Montojo
> Sent: Montag, 17. September 2007 17:23
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] ICDescriptor.saveProjectData() doesn't
> always serializeto .cproject
>
>
> Hi everyone,
>
> I'm using ICDescriptor to serialize project language mappings
> to .cproject.
> When I add language mappings to a project, sometimes they get
> saved and sometimes they don't. Here's the general pattern
> I'm using to update the
> descriptor:
>
> ICDescriptor descriptor = getProjectDescription(project);
> Element rootElement =
> descriptor.getProjectData(LANGUAGE_MAPPING_ID);
>
> // Update rootElement with new language mappings
>
> descriptor.saveProjectData();
>
> I stepped through the code and ended up in
> SetCProjectDescriptionOperation.executeOperation():66
>
> modified = fNewDescriptionCache.applyDatas(context);
>
> The line above sets modified to false, so the .cproject
> doesn't get serialized with the updated language mappings.
> However, the correct ICDescriptor with the language mappings
> is resident in memory so the mappings show up in the property pages.
>
> Is there something special I need to do to get
> fNewDescriptionCache.applyDatas() to return true?
>
> Thanks,
>
> Jason Montojo
> IBM CDT Team
> IBM Toronto Lab
> 905-413-5228
> jmontojo@xxxxxxxxxx
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>