* Improved BNotification API.
- No more manual memory management. - Make it clear who keeps or releases ownership of arguments passed. - Copy icon, arguments and entry_refs. - Do not expose implementation details (What do the BLists contain?!). - BRoster takes const BNotification& and bigtime_t timeout. * BRoster::Notify(): - Proper error handling. - Fixed documentation. * Adjusted notify: - Renamed fOk to fHasGoodArguments. - The "const char*" members were really "char*" members (self-managed). - free() is NULL-safe. - fRefs contains BEntries, so passing void* to delete does no good. - Adjustments to the changed API. - Coding style fixes. * notification_server: - Adjustment to the new type for timeout. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36952 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
* Michael Davidson, [email protected]
|
||||
* Mikael Eiman, [email protected]
|
||||
* Pier Luigi Fiorini, [email protected]
|
||||
* Stephan Aßmus <[email protected]>
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -122,14 +123,13 @@ NotificationView::AttachedToWindow()
|
||||
{
|
||||
BMessage msg(kRemoveView);
|
||||
msg.AddPointer("view", this);
|
||||
int32 timeout = -1;
|
||||
bigtime_t timeout = -1;
|
||||
|
||||
if (fDetails->FindInt32("timeout", &timeout) != B_OK)
|
||||
timeout = fParent->Timeout();
|
||||
bigtime_t delay = timeout * 1000 * 1000;
|
||||
|
||||
if (delay > 0)
|
||||
fRunner = new BMessageRunner(BMessenger(Parent()), &msg, delay, 1);
|
||||
if (fDetails->FindInt64("timeout", &timeout) != B_OK)
|
||||
timeout = fParent->Timeout() * 1000000;
|
||||
|
||||
if (timeout > 0)
|
||||
fRunner = new BMessageRunner(BMessenger(Parent()), &msg, timeout, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user