Add the possibility to load all add-ons in a directory immediately.

Rename _HandlePulse to _HandlePendingEntries.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38433 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2010-08-29 22:05:33 +00:00
parent 1e2c72fcfc
commit 588b796bcb
2 changed files with 11 additions and 5 deletions

View File

@ -40,7 +40,10 @@ public:
// Note that directories are not watched recursively, and all entries
// are reported as add-ons regardless of their node type (files,
// directories, symlinks).
virtual status_t AddDirectory(const node_ref* nref);
// If sync is true all pending add-on entries are handled immediately.
// Including entries from other directories.
virtual status_t AddDirectory(const node_ref* nref,
bool sync = false);
protected:
// hooks for sub-class
@ -66,7 +69,7 @@ protected:
virtual void StatChanged(ino_t node, dev_t device);
private:
void _HandlePulse();
void _HandlePendingEntries();
void _EntryCreated(add_on_entry_info& info);
typedef NodeMonitorHandler inherited;

View File

@ -47,14 +47,14 @@ void
AddOnMonitorHandler::MessageReceived(BMessage* msg)
{
if (msg->what == B_PULSE)
_HandlePulse();
_HandlePendingEntries();
inherited::MessageReceived(msg);
}
status_t
AddOnMonitorHandler::AddDirectory(const node_ref* nref)
AddOnMonitorHandler::AddDirectory(const node_ref* nref, bool sync)
{
// Keep the looper thread locked, since this method is likely to be called
// in a thread other than the looper thread. Otherwise we may access the
@ -98,6 +98,9 @@ AddOnMonitorHandler::AddDirectory(const node_ref* nref)
fPendingEntries.push_back(entryInfo);
}
if (sync)
_HandlePendingEntries();
return B_OK;
}
@ -441,7 +444,7 @@ AddOnMonitorHandler::StatChanged(ino_t node, dev_t device)
//! Process pending entries.
void
AddOnMonitorHandler::_HandlePulse()
AddOnMonitorHandler::_HandlePendingEntries()
{
BDirectory directory;
EntryList::iterator iter = fPendingEntries.begin();