* More cleanup, improved error return codes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33872 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -193,7 +193,7 @@ ServerApp::~ServerApp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = fPictureList.CountItems(); i-- > 0;) {
|
for (int32 i = fPictureList.CountItems(); i-- > 0;) {
|
||||||
delete (ServerPicture*)fPictureList.ItemAtFast(i);
|
delete fPictureList.ItemAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
fDesktop->GetCursorManager().DeleteCursors(fClientTeam);
|
fDesktop->GetCursorManager().DeleteCursors(fClientTeam);
|
||||||
@@ -743,12 +743,13 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
{
|
{
|
||||||
// TODO: Maybe rename this to AS_UPLOAD_PICTURE ?
|
// TODO: Maybe rename this to AS_UPLOAD_PICTURE ?
|
||||||
STRACE(("ServerApp %s: Create Picture\n", Signature()));
|
STRACE(("ServerApp %s: Create Picture\n", Signature()));
|
||||||
status_t status = B_ERROR;
|
status_t status = B_NO_MEMORY;
|
||||||
|
|
||||||
ServerPicture* picture = CreatePicture();
|
ServerPicture* picture = CreatePicture();
|
||||||
if (picture != NULL) {
|
if (picture != NULL) {
|
||||||
int32 subPicturesCount = 0;
|
int32 subPicturesCount = 0;
|
||||||
link.Read<int32>(&subPicturesCount);
|
link.Read<int32>(&subPicturesCount);
|
||||||
for (int32 c = 0; c < subPicturesCount; c++) {
|
for (int32 i = 0; i < subPicturesCount; i++) {
|
||||||
int32 token = -1;
|
int32 token = -1;
|
||||||
link.Read<int32>(&token);
|
link.Read<int32>(&token);
|
||||||
if (ServerPicture* subPicture = FindPicture(token))
|
if (ServerPicture* subPicture = FindPicture(token))
|
||||||
@@ -760,7 +761,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
fLink.Attach<int32>(picture->Token());
|
fLink.Attach<int32>(picture->Token());
|
||||||
} else
|
} else
|
||||||
fLink.StartMessage(B_ERROR);
|
fLink.StartMessage(status);
|
||||||
|
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
@@ -772,7 +773,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
int32 token;
|
int32 token;
|
||||||
if (link.Read<int32>(&token) == B_OK)
|
if (link.Read<int32>(&token) == B_OK)
|
||||||
DeletePicture(token);
|
DeletePicture(token);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -784,15 +784,15 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
if (link.Read<int32>(&token) == B_OK)
|
if (link.Read<int32>(&token) == B_OK)
|
||||||
original = FindPicture(token);
|
original = FindPicture(token);
|
||||||
|
|
||||||
ServerPicture *cloned = NULL;
|
if (original != NULL) {
|
||||||
if (original != NULL)
|
ServerPicture* cloned = CreatePicture(original);
|
||||||
cloned = CreatePicture(original);
|
|
||||||
|
|
||||||
if (cloned != NULL) {
|
if (cloned != NULL) {
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
fLink.Attach<int32>(cloned->Token());
|
fLink.Attach<int32>(cloned->Token());
|
||||||
} else
|
} else
|
||||||
fLink.StartMessage(B_ERROR);
|
fLink.StartMessage(B_NO_MEMORY);
|
||||||
|
} else
|
||||||
|
fLink.StartMessage(B_BAD_VALUE);
|
||||||
|
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
break;
|
break;
|
||||||
@@ -811,7 +811,6 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
fLink.StartMessage(B_ERROR);
|
fLink.StartMessage(B_ERROR);
|
||||||
|
|
||||||
fLink.Flush();
|
fLink.Flush();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ private:
|
|||||||
// remember which ones they own so that they can destroy them when
|
// remember which ones they own so that they can destroy them when
|
||||||
// they quit.
|
// they quit.
|
||||||
BList fBitmapList;
|
BList fBitmapList;
|
||||||
BList fPictureList;
|
BObjectList<ServerPicture> fPictureList;
|
||||||
|
|
||||||
ServerCursor* fAppCursor;
|
ServerCursor* fAppCursor;
|
||||||
ServerCursor* fViewCursor;
|
ServerCursor* fViewCursor;
|
||||||
|
|||||||
Reference in New Issue
Block a user