Opened 17 years ago

Closed 17 years ago

Last modified 6 years ago

#8740 closed patch

SAVEFILEMAN: renameSavefile implementation

Reported by: peres Owned by: fingolfin
Priority: normal Component: --Other--
Version: Keywords:
Cc: Game:


Here is an implementation for SavefileManager::renameSavefile, as Fingolfin suggested on scummvm-devel.

Ticket imported from: #1825132. Ticket imported from: patches/845.

Attachments (2)

renameSavefile.patch (2.3 KB ) - added by peres 17 years ago.
WORKING renameSavefile implementation
renameSavefile-alt.patch (1.7 KB ) - added by fingolfin 17 years ago.
alternate patch

Download all attachments as: .zip

Change History (8)

by peres, 17 years ago

Attachment: renameSavefile.patch added

WORKING renameSavefile implementation

comment:1 by peres, 17 years ago

The first patch I posted was broken (I removed it from the tracker). Please make sure you got the right one. File Added: renameSavefile.patch

comment:2 by cyxx, 17 years ago

One remark : OutSaveFile::finalize() can set the io_failed flag to 1, so I would call it just after write(), ie.

outFile->write(buffer, size); + outFile->finalize(); status |= (outFile->ioFailed()) ? NOTHING_DONE : COPIED;

Wouldn't it be also possible to simplify the code a bit by removing a few if ? It's legal to call delete() and free() with a NULL/0 ptr.

by fingolfin, 17 years ago

Attachment: renameSavefile-alt.patch added

alternate patch

comment:3 by fingolfin, 17 years ago

Indeed. Here's a modified version of the patch... File Added: renameSavefile-alt.patch

comment:4 by fingolfin, 17 years ago

Since nobody complained, I just checked my alternate version in. I figure we can make fixes etc. afterwards anyway, but for now I want this to be in the API asap.

comment:5 by fingolfin, 17 years ago

Owner: set to fingolfin
Status: newclosed

comment:6 by digitall, 6 years ago

Component: --Other--
Note: See TracTickets for help on using tickets.