Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349481

Summary: Modifying a project silently fails when .cproject is read-only
Product: [Tools] CDT Reporter: Baltasar Belyavsky <bbelyavsky>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: christelle.burguera, claes.stejre, marcin.swiezawski, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Baltasar Belyavsky CLA 2011-06-15 13:50:01 EDT
Build Identifier: I20110428-0848 [Indigo M7]

When the .cproject file is read-only, making changes to the project only takes effect in the object-model, but not persisted into the .cproject file.  This, in itself, probably isn't bad, but the problem is that the user isn't notified of this in any way, so the user believes the changes were saved.  Then, closing and reopening the project (or reimporting it) causes all in-memory changes to be reverted.

If source-control is integrated, attempts to save the .cproject file should probably cause the file to be checked out.  But if no source-control integration is present, and the .cproject file is read-only, then some kind of a visual notification has to be shown to the user.  The .project file causes an error message to be popped up in this case.

Reproducible: Always

Steps to Reproduce:
1. Create any simple project.
2. Set both the .project and the .cproject files to be read-only.
3. Add a CDT project-dependency using the C/C++ General > Paths and Symbols > References tab.
-> The change appears to take effect, but it's only in-memory - closing/reopening the project reverts to original state.
4. Now add a project reference using the Platform UI (Project References page).
-> An error is popped up saying that the .project file is read-only, and the change does take effect in-memory.
Comment 1 Andrew Gvozdev CLA 2011-06-15 17:05:11 EDT
Not sure how useful now but bug 80075 got a patch for .cdtbuild file.