reusing the old settings message is a good idea (thanks Axel!)

we simply remove color data before storing the workspace color


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17130 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-04-14 10:50:47 +00:00
parent 8be3635fcf
commit 68b599fbcc
2 changed files with 5 additions and 1 deletions

View File

@ -663,8 +663,11 @@ Desktop::RedrawBackground()
void
Desktop::StoreWorkspaceConfiguration(int32 index)
{
const BMessage *oldSettings = fSettings->WorkspacesMessage(index);
// store settings
BMessage settings;
if (oldSettings)
settings = *oldSettings;
fWorkspaces[index].StoreConfiguration(settings);
fSettings->SetWorkspacesMessage(index, settings);
fSettings->Save(kWorkspacesSettings);

View File

@ -54,12 +54,13 @@ Workspace::Private::RestoreConfiguration(const BMessage& settings)
/*!
\brief Store the workspace configuration in an empty message
\brief Store the workspace configuration in a message
*/
void
Workspace::Private::StoreConfiguration(BMessage& settings)
{
rgb_color color = fColor.GetColor32();
settings.RemoveName("color");
settings.AddInt32("color", *(int32 *)&color);
}