Q:

How to detect when project was moved to a new location

It seems that it isn't possible to detect if a project was moved from one location to another location by using an IResourceChangeListener.
For example, when changing the project's location from /old/path/to/project to /new/path/to/project with the MoveProjectOperation, the event details look like this:
name = project-name
kind = CHANGE 
flags = DESCRIPTION  
movedFromPath = null 
movedToPath = null 
location = /new/path/to/project

However, the same event details are sent when the project description was changed for some other reason.
The JavaDoc of IResourceDelta::getFlags() and a forum post give a hint that there is a MOVED_FROM flag and getMovedFromPath() will return the path of where a resource was moved from. But I didn't see any such event.
Is there really no way to tell if a project is moved or am I missing something? If there is a workaround I would also be glad to head about.

A:

I think I have found a workaround. The fix is to maintain a snapshot of current project descriptions (IProjectDescription). A project description also contains the project location.
The snapshot would need to be updated when the move detection code starts and whenever a new project was created.
Whenever a DESCRIPTION change event as described in the question occurs, I can compare the project.getLocationURI() with the location of the project description from the snapshot. If they differ, the project was moved. Otherwise, an uninteresting change occurred.

