Bug 455200 - Session dirty after an undo while it was sync before the command execution
Summary: Session dirty after an undo while it was sync before the command execution
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-12-15 06:07 EST by Esteban DUGUEPEROUX CLA
Modified: 2014-12-18 08:33 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Esteban DUGUEPEROUX CLA 2014-12-15 06:07:11 EST
In Sirius dialect editors with the following scenario :

1. Open any representation with its associated editor
2. Save if needed
3. Execute a EMF Command doing model changes, the editor become dirty
4. Undo, the editor is always dirty while it could be sync

Indeed, in EMF tree based editor and in GMF sample editors, starting from a saved content executing N commands and doing N undo, the editor is no more dirty, with a limit on N.

This is possible with BasicCommandStack.saveIsDone()/isSaveNeeded() API.
Comment 1 Esteban DUGUEPEROUX CLA 2014-12-16 05:51:09 EST
For GMF editor, this is managed in GMFResourceModificationManager.getHistoryListener().

The concept is similarly the same to manage that :

1. Keep a reference to the last executed operation
2. Keep a reference to the last operation for which a save has been done just after
3. If "next operation in undo list" == "last operation for which a save has been done just after" => save is not needed

This is done using a specific IUndoContext.
Comment 2 Florian Barbin CLA 2014-12-18 08:33:07 EST
I would say this is more a bug than an enhancement. The user expecting no more dirty after what you described.