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:
@@ -548,19 +548,20 @@ TermWindow::_SaveWindowPosition()
|
|||||||
BFile file;
|
BFile file;
|
||||||
BMessage originalSettings;
|
BMessage originalSettings;
|
||||||
|
|
||||||
// We append ourself to the existing settings file
|
// Read the settings file if it exists and is a valid BMessage.
|
||||||
// So we have to read it, insert our BMessage, and rewrite it.
|
|
||||||
|
|
||||||
status_t status = _GetWindowPositionFile(&file, B_READ_ONLY);
|
status_t status = _GetWindowPositionFile(&file, B_READ_ONLY);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
originalSettings.Unflatten(&file);
|
status = originalSettings.Unflatten(&file);
|
||||||
// No error checking on that : it fails if the settings
|
|
||||||
// file is missing, but we can create it.
|
|
||||||
|
|
||||||
file.Unset();
|
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();
|
int32 id = fTerminalRoster.ID();
|
||||||
BRect rect(Frame());
|
BRect rect(Frame());
|
||||||
if (originalSettings.ReplaceRect("rect", id, rect) != B_OK)
|
if (originalSettings.ReplaceRect("rect", id, rect) != B_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user