Changeset 17585
- Timestamp:
- 05/25/06 08:30:30 (3 years ago)
- Files:
-
- 1 modified
-
haiku/trunk/src/kits/app/Roster.cpp (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
haiku/trunk/src/kits/app/Roster.cpp
r17478 r17585 329 329 // compose the request message 330 330 BMessage request(B_REG_GET_APP_LIST); 331 331 332 // send the request 332 333 BMessage reply; 333 334 if (error == B_OK) 334 335 error = fMessenger.SendMessage(&request, &reply); 336 335 337 // evaluate the reply 336 338 if (error == B_OK) { … … 340 342 teamIDList->AddItem((void*)team); 341 343 } else { 342 reply.FindInt32("error", &error); 344 if (reply.FindInt32("error", &error) != B_OK) 345 error = B_ERROR; 343 346 DBG(OUT("Roster request unsuccessful: %s\n", strerror(error))); 344 347 DBG(reply.PrintToStream()); … … 369 372 if (error == B_OK) 370 373 error = request.AddString("signature", sig); 374 371 375 // send the request 372 376 BMessage reply; 373 377 if (error == B_OK) 374 378 error = fMessenger.SendMessage(&request, &reply); 379 375 380 // evaluate the reply 376 381 if (error == B_OK) { … … 379 384 for (int32 i = 0; reply.FindInt32("teams", i, &team) == B_OK; i++) 380 385 teamIDList->AddItem((void*)team); 381 } else 382 reply.FindInt32("error", &error);386 } else if (reply.FindInt32("error", &error) != B_OK) 387 error = B_ERROR; 383 388 } 384 389 } … … 404 409 if (error == B_OK) 405 410 error = request.AddString("signature", sig); 411 406 412 // send the request 407 413 BMessage reply; 408 414 if (error == B_OK) 409 415 error = fMessenger.SendMessage(&request, &reply); 416 410 417 // evaluate the reply 411 418 if (error == B_OK) { 412 419 if (reply.what == B_REG_SUCCESS) 413 420 error = find_message_app_info(&reply, info); 414 else 415 reply.FindInt32("error", &error);421 else if (reply.FindInt32("error", &error) != B_OK) 422 error = B_ERROR; 416 423 } 417 424 return error; … … 438 445 if (error == B_OK) 439 446 error = request.AddRef("ref", ref); 447 440 448 // send the request 441 449 BMessage reply; 442 450 if (error == B_OK) 443 451 error = fMessenger.SendMessage(&request, &reply); 452 444 453 // evaluate the reply 445 454 if (error == B_OK) { 446 455 if (reply.what == B_REG_SUCCESS) 447 456 error = find_message_app_info(&reply, info); 448 else 449 reply.FindInt32("error", &error);457 else if (reply.FindInt32("error", &error) != B_OK) 458 error = B_ERROR; 450 459 } 451 460 return error; … … 477 486 if (error == B_OK) 478 487 error = fMessenger.SendMessage(&request, &reply); 488 479 489 // evaluate the reply 480 490 if (error == B_OK) { 481 491 if (reply.what == B_REG_SUCCESS) 482 492 error = find_message_app_info(&reply, info); 483 else 484 reply.FindInt32("error", &error);493 else if (reply.FindInt32("error", &error) != B_OK) 494 error = B_ERROR; 485 495 } 486 496 return error; … … 510 520 if (reply.what == B_REG_SUCCESS) 511 521 error = find_message_app_info(&reply, info); 512 else 513 reply.FindInt32("error", &error);522 else if (reply.FindInt32("error", &error) != B_OK) 523 error = B_ERROR; 514 524 } 515 525 return error; … … 649 659 if (error == B_OK) 650 660 error = request.AddMessenger("reply_target", replyTo); 661 651 662 // send the request 652 663 BMessage reply; 653 664 if (error == B_OK) 654 665 error = fMessenger.SendMessage(&request, &reply); 666 655 667 // evaluate the reply 656 if (error == B_OK && reply.what != B_REG_SUCCESS) 657 reply.FindInt32("error", &error); 668 if (error == B_OK && reply.what != B_REG_SUCCESS 669 && reply.FindInt32("error", &error) != B_OK) 670 error = B_ERROR; 671 658 672 return error; 659 673 } … … 703 717 if (error == B_OK) 704 718 error = request.AddInt32("events", (int32)eventMask); 719 705 720 // send the request 706 721 BMessage reply; 707 722 if (error == B_OK) 708 723 error = fMessenger.SendMessage(&request, &reply); 724 709 725 // evaluate the reply 710 if (error == B_OK && reply.what != B_REG_SUCCESS) 711 reply.FindInt32("error", &error); 726 if (error == B_OK && reply.what != B_REG_SUCCESS 727 && reply.FindInt32("error", &error) != B_OK) 728 error = B_ERROR; 729 712 730 return error; 713 731 } … … 729 747 if (error == B_OK) 730 748 error = request.AddMessenger("target", target); 749 731 750 // send the request 732 751 BMessage reply; 733 752 if (error == B_OK) 734 753 error = fMessenger.SendMessage(&request, &reply); 754 735 755 // evaluate the reply 736 if (error == B_OK && reply.what != B_REG_SUCCESS) 737 reply.FindInt32("error", &error); 756 if (error == B_OK && reply.what != B_REG_SUCCESS 757 && reply.FindInt32("error", &error) != B_OK) 758 error = B_ERROR; 759 738 760 return error; 739 761 } … … 1361 1383 1362 1384 // evaluate the reply 1363 if (error == B_OK && reply.what != B_REG_SUCCESS) 1364 reply.FindInt32("error", &error); 1385 if (error == B_OK && reply.what != B_REG_SUCCESS 1386 && reply.FindInt32("error", &error) != B_OK) 1387 error = B_ERROR; 1365 1388 1366 1389 return error; … … 1449 1472 } 1450 1473 } else { 1451 reply.FindInt32("error", &error); 1474 if (reply.FindInt32("error", &error) != B_OK) 1475 error = B_ERROR; 1452 1476 if (otherTeam) 1453 1477 reply.FindInt32("other_team", otherTeam); … … 1480 1504 if (error == B_OK && mimeSig) 1481 1505 error = request.AddString("signature", mimeSig); 1506 1482 1507 // send the request 1483 1508 BMessage reply; 1484 1509 if (error == B_OK) 1485 1510 error = fMessenger.SendMessage(&request, &reply); 1511 1486 1512 // evaluate the reply 1487 if (error == B_OK && reply.what != B_REG_SUCCESS) 1488 reply.FindInt32("error", &error); 1513 if (error == B_OK && reply.what != B_REG_SUCCESS 1514 && reply.FindInt32("error", &error) != B_OK) 1515 error = B_ERROR; 1516 1489 1517 return error; 1490 1518 } … … 1528 1556 if (error == B_OK && thread >= 0) 1529 1557 error = request.AddInt32("thread", thread); 1558 1530 1559 // send the request 1531 1560 BMessage reply; 1532 1561 if (error == B_OK) 1533 1562 error = fMessenger.SendMessage(&request, &reply); 1563 1534 1564 // evaluate the reply 1535 if (error == B_OK && reply.what != B_REG_SUCCESS) 1536 reply.FindInt32("error", &error); 1565 if (error == B_OK && reply.what != B_REG_SUCCESS 1566 && reply.FindInt32("error", &error) != B_OK) 1567 error = B_ERROR; 1568 1537 1569 return error; 1538 1570 } … … 1566 1598 if (error == B_OK && port >= 0) 1567 1599 error = request.AddInt32("port", port); 1600 1568 1601 // send the request 1569 1602 BMessage reply; 1570 1603 if (error == B_OK) 1571 1604 error = fMessenger.SendMessage(&request, &reply); 1605 1572 1606 // evaluate the reply 1573 if (error == B_OK && reply.what != B_REG_SUCCESS) 1574 reply.FindInt32("error", &error); 1607 if (error == B_OK && reply.what != B_REG_SUCCESS 1608 && reply.FindInt32("error", &error) != B_OK) 1609 error = B_ERROR; 1610 1575 1611 return error; 1576 1612 } … … 1612 1648 if (error == B_OK && isPreRegistered && info) 1613 1649 error = find_message_app_info(&reply, info); 1614 } else 1615 reply.FindInt32("error", &error);1616 } 1617 return (error == B_OK && isPreRegistered);1650 } else if (reply.FindInt32("error", &error) != B_OK) 1651 error = B_ERROR; 1652 } 1653 return error == B_OK && isPreRegistered; 1618 1654 } 1619 1655 … … 1640 1676 if (error == B_OK) 1641 1677 error = request.AddInt32("token", (int32)entryToken); 1678 1642 1679 // send the request 1643 1680 BMessage reply; 1644 1681 if (error == B_OK) 1645 1682 error = fMessenger.SendMessage(&request, &reply); 1683 1646 1684 // evaluate the reply 1647 if (error == B_OK && reply.what != B_REG_SUCCESS) 1648 reply.FindInt32("error", &error); 1685 if (error == B_OK && reply.what != B_REG_SUCCESS 1686 && reply.FindInt32("error", &error) != B_OK) 1687 error = B_ERROR; 1688 1649 1689 return error; 1650 1690 } … … 1671 1711 if (error == B_OK && team >= 0) 1672 1712 error = request.AddInt32("team", team); 1713 1673 1714 // send the request 1674 1715 BMessage reply; 1675 1716 if (error == B_OK) 1676 1717 error = fMessenger.SendMessage(&request, &reply); 1718 1677 1719 // evaluate the reply 1678 if (error == B_OK && reply.what != B_REG_SUCCESS) 1679 reply.FindInt32("error", &error); 1720 if (error == B_OK && reply.what != B_REG_SUCCESS 1721 && reply.FindInt32("error", &error) != B_OK) 1722 error = B_ERROR; 1723 1680 1724 return error; 1681 1725 }
