Page MenuHome

Implements T38262 'Revert from saved file'
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jan 23 2014, 1:21 AM.

Details

Summary

Adds an item to the file menu that allows a user to revert to their last saved file.

Task can be found here: https://developer.blender.org/T38262

Diff Detail

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Jan 23 2014, 2:22 AM
Campbell Barton (campbellbarton) added inline comments.
source/blender/windowmanager/intern/wm_operators.c
2497

Checking filename isnt NULL makes no sense, its assigned from a fixed length array.

also referencing both G.main->name and filename is unnecessarily confusing (use one or the other)

strlen(G.main->name) can be replaced with filename[0]

2500

no need to check for reports operators always set.

2500

If the filename doesnt exist, it should probably report that... or allow open to.

2509

even if this fails it will return finished, think this should return canceled on failure.

2516

no need to check fixed lenth array for NULL, just check G.main->name[0] is enough

Matthew Turner (DeadlyFugu) updated this revision to Unknown Object (????).Jan 24 2014, 1:20 AM

Should fix all problems pointed out by campbellbarton.

committed rB5643c29fbeacf699b47e84b4d2abc9f20b23cb7c after some refactoring to simplify the patch.