Small fix. Helps when doing a Close All from Deskbar and the Terminals all flatten/unflatten all over each other.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40591 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2011-02-21 04:02:50 +00:00
parent 80d265a95f
commit 27f365eaa3

View File

@ -548,19 +548,20 @@ TermWindow::_SaveWindowPosition()
BFile file;
BMessage originalSettings;
// We append ourself to the existing settings file
// So we have to read it, insert our BMessage, and rewrite it.
// Read the settings file if it exists and is a valid BMessage.
status_t status = _GetWindowPositionFile(&file, B_READ_ONLY);
if (status == B_OK) {
originalSettings.Unflatten(&file);
// No error checking on that : it fails if the settings
// file is missing, but we can create it.
status = originalSettings.Unflatten(&file);
file.Unset();
if (status != B_OK)
status = originalSettings.MakeEmpty();
if (status != B_OK)
return status;
}
// Append the new settings
// Replace the settings
int32 id = fTerminalRoster.ID();
BRect rect(Frame());
if (originalSettings.ReplaceRect("rect", id, rect) != B_OK)