Revert "Fix for bug 6991, replace registrars timer tick"
Unintentional commit, still not used to gerrit things
This reverts commit a02e4534f5
.
This commit is contained in:
parent
ea0dc313dc
commit
ffbedf6088
@ -96,6 +96,7 @@ enum {
|
||||
B_REG_GET_MESSAGE_RUNNER_INFO = 'rgri',
|
||||
|
||||
// internal registrar messages
|
||||
B_REG_ROSTER_SANITY_EVENT = 'rgir',
|
||||
B_REG_SHUTDOWN_FINISHED = 'rgsf',
|
||||
B_REG_ROSTER_DEVICE_RESCAN = 'rgrs',
|
||||
|
||||
|
@ -16,11 +16,9 @@
|
||||
#include <Application.h>
|
||||
#include <Clipboard.h>
|
||||
#include <Message.h>
|
||||
#include <MessengerPrivate.h>
|
||||
#include <OS.h>
|
||||
#include <RegistrarDefs.h>
|
||||
#include <RosterPrivate.h>
|
||||
#include <system_info.h>
|
||||
|
||||
#include "AuthenticationManager.h"
|
||||
#include "ClipboardHandler.h"
|
||||
@ -49,6 +47,9 @@ using namespace BPrivate;
|
||||
//! Name of the event queue.
|
||||
static const char *kEventQueueName = "timer_thread";
|
||||
|
||||
//! Time interval between two roster sanity checks (1 s).
|
||||
static const bigtime_t kRosterSanityEventInterval = 1000000LL;
|
||||
|
||||
|
||||
/*! \brief Creates the registrar application class.
|
||||
\param error Passed to the BApplication constructor for returning an
|
||||
@ -62,6 +63,7 @@ Registrar::Registrar(status_t* _error)
|
||||
fMIMEManager(NULL),
|
||||
fEventQueue(NULL),
|
||||
fMessageRunnerManager(NULL),
|
||||
fSanityEvent(NULL),
|
||||
fShutdownProcess(NULL),
|
||||
fAuthenticationManager(NULL),
|
||||
fPackageWatchingManager(NULL)
|
||||
@ -86,6 +88,7 @@ Registrar::~Registrar()
|
||||
delete fPackageWatchingManager;
|
||||
delete fMessageRunnerManager;
|
||||
delete fEventQueue;
|
||||
delete fSanityEvent;
|
||||
fMIMEManager->Lock();
|
||||
fMIMEManager->Quit();
|
||||
RemoveHandler(fClipboardHandler);
|
||||
@ -169,15 +172,11 @@ Registrar::ReadyToRun()
|
||||
// create the package watching manager
|
||||
fPackageWatchingManager = new PackageWatchingManager;
|
||||
|
||||
// Sanity check roster after team deletion
|
||||
BMessenger target(this);
|
||||
BMessenger::Private messengerPrivate(target);
|
||||
|
||||
port_id port = messengerPrivate.Port();
|
||||
int32 token = messengerPrivate.Token();
|
||||
__start_watching_system(-1, B_WATCH_SYSTEM_TEAM_DELETION, port, token);
|
||||
//Clean up any early teams
|
||||
fRoster->CheckSanity();
|
||||
// create and schedule the sanity message event
|
||||
fSanityEvent = new MessageEvent(system_time() + kRosterSanityEventInterval,
|
||||
this, B_REG_ROSTER_SANITY_EVENT);
|
||||
fSanityEvent->SetAutoDelete(false);
|
||||
fEventQueue->AddEvent(fSanityEvent);
|
||||
|
||||
FUNCTION_END();
|
||||
}
|
||||
@ -353,13 +352,11 @@ Registrar::_MessageReceived(BMessage *message)
|
||||
break;
|
||||
|
||||
// internal messages
|
||||
case B_SYSTEM_OBJECT_UPDATE:
|
||||
{
|
||||
team_id team = (team_id)message->GetInt32("team", -1);
|
||||
if (team >= 0 && message->GetInt32("opcode", 0) == B_TEAM_DELETED)
|
||||
fRoster->HandleRemoveApp(message);
|
||||
case B_REG_ROSTER_SANITY_EVENT:
|
||||
fRoster->CheckSanity();
|
||||
fSanityEvent->SetTime(system_time() + kRosterSanityEventInterval);
|
||||
fEventQueue->AddEvent(fSanityEvent);
|
||||
break;
|
||||
}
|
||||
case B_REG_SHUTDOWN_FINISHED:
|
||||
if (fShutdownProcess) {
|
||||
fShutdownProcess->PostMessage(B_QUIT_REQUESTED,
|
||||
|
@ -64,6 +64,7 @@ private:
|
||||
MIMEManager *fMIMEManager;
|
||||
EventQueue *fEventQueue;
|
||||
MessageRunnerManager *fMessageRunnerManager;
|
||||
MessageEvent *fSanityEvent;
|
||||
ShutdownProcess *fShutdownProcess;
|
||||
AuthenticationManager *fAuthenticationManager;
|
||||
PackageWatchingManager *fPackageWatchingManager;
|
||||
|
Loading…
Reference in New Issue
Block a user