Update NodeMonitorHandler to use all haiku specific fields.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39022 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -61,11 +61,12 @@ protected:
|
||||
protected:
|
||||
virtual void EntryCreated(const char* name, ino_t directory,
|
||||
dev_t device, ino_t node);
|
||||
virtual void EntryRemoved(ino_t directory, dev_t device,
|
||||
ino_t node);
|
||||
virtual void EntryMoved(const char* name,
|
||||
ino_t fromDirectory, ino_t toDirectory,
|
||||
virtual void EntryRemoved(const char *name, ino_t directory,
|
||||
dev_t device, ino_t node);
|
||||
virtual void EntryMoved(const char *name,
|
||||
const char *fromName, ino_t from_directory,
|
||||
ino_t to_directory, dev_t device,
|
||||
ino_t node, dev_t nodeDevice);
|
||||
virtual void StatChanged(ino_t node, dev_t device);
|
||||
|
||||
private:
|
||||
|
||||
@@ -27,14 +27,16 @@ static void make_node_ref(dev_t device, ino_t node, node_ref * ref);
|
||||
protected:
|
||||
// hooks for subclass
|
||||
virtual void EntryCreated(const char *name, ino_t directory,
|
||||
dev_t device, ino_t node);
|
||||
virtual void EntryRemoved(ino_t directory, dev_t device, ino_t node);
|
||||
virtual void EntryMoved(const char *name, ino_t from_directory,
|
||||
ino_t to_directory, dev_t device, ino_t node);
|
||||
dev_t device, ino_t node);
|
||||
virtual void EntryRemoved(const char *name, ino_t directory,
|
||||
dev_t device, ino_t node);
|
||||
virtual void EntryMoved(const char *name, const char *fromName,
|
||||
ino_t from_directory, ino_t to_directory, dev_t device,
|
||||
ino_t node, dev_t nodeDevice);
|
||||
virtual void StatChanged(ino_t node, dev_t device);
|
||||
virtual void AttrChanged(ino_t node, dev_t device);
|
||||
virtual void DeviceMounted(dev_t new_device, dev_t device,
|
||||
ino_t directory);
|
||||
ino_t directory);
|
||||
virtual void DeviceUnmounted(dev_t new_device);
|
||||
|
||||
private:
|
||||
|
||||
@@ -149,7 +149,8 @@ AddOnMonitorHandler::EntryCreated(const char* name, ino_t directory,
|
||||
|
||||
|
||||
void
|
||||
AddOnMonitorHandler::EntryRemoved(ino_t directory, dev_t device, ino_t node)
|
||||
AddOnMonitorHandler::EntryRemoved(const char* name, ino_t directory,
|
||||
dev_t device, ino_t node)
|
||||
{
|
||||
node_ref entryNodeRef;
|
||||
make_node_ref(device, node, &entryNodeRef);
|
||||
@@ -212,15 +213,16 @@ AddOnMonitorHandler::EntryRemoved(ino_t directory, dev_t device, ino_t node)
|
||||
|
||||
|
||||
void
|
||||
AddOnMonitorHandler::EntryMoved(const char* name, ino_t fromDirectory,
|
||||
ino_t toDirectory, dev_t device, ino_t node)
|
||||
AddOnMonitorHandler::EntryMoved(const char *name, const char *fromName,
|
||||
ino_t from_directory, ino_t to_directory, dev_t device, ino_t node,
|
||||
dev_t nodeDevice)
|
||||
{
|
||||
node_ref toNodeRef;
|
||||
make_node_ref(device, toDirectory, &toNodeRef);
|
||||
make_node_ref(device, to_directory, &toNodeRef);
|
||||
|
||||
// Search the "from" and "to" directory in the known directories
|
||||
DirectoryList::iterator from_iter = fDirectories.begin();
|
||||
bool watchingFromDirectory = _FindDirectory(fromDirectory, device,
|
||||
bool watchingFromDirectory = _FindDirectory(from_directory, device,
|
||||
from_iter);
|
||||
|
||||
DirectoryList::iterator to_iter = fDirectories.begin();
|
||||
@@ -342,7 +344,7 @@ AddOnMonitorHandler::EntryMoved(const char* name, ino_t fromDirectory,
|
||||
// the entry and readding it. TODO: This can temporarily enable add-ons
|
||||
// which should in fact stay hidden (moving add-on from home to common
|
||||
// folder or vice versa, the system add-on should remain hidden).
|
||||
EntryRemoved(fromDirectory, device, node);
|
||||
EntryRemoved(name, from_directory, device, node);
|
||||
info.dir_nref = toNodeRef;
|
||||
_EntryCreated(info);
|
||||
} else {
|
||||
|
||||
@@ -86,22 +86,24 @@ NodeMonitorHandler::MessageReceived(BMessage * msg)
|
||||
|
||||
/* virtual */ void
|
||||
NodeMonitorHandler::EntryCreated(const char *name, ino_t directory,
|
||||
dev_t device, ino_t node)
|
||||
dev_t device, ino_t node)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
|
||||
/* virtual */ void
|
||||
NodeMonitorHandler::EntryRemoved(ino_t directory, dev_t device, ino_t node)
|
||||
NodeMonitorHandler::EntryRemoved(const char *name, ino_t directory,
|
||||
dev_t device, ino_t node)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
|
||||
/* virtual */ void
|
||||
NodeMonitorHandler::EntryMoved(const char *name, ino_t from_directory,
|
||||
ino_t to_directory, dev_t device, ino_t node)
|
||||
NodeMonitorHandler::EntryMoved(const char *name, const char *fromName,
|
||||
ino_t from_directory, ino_t to_directory, dev_t device,ino_t node,
|
||||
dev_t nodeDevice)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
@@ -123,7 +125,7 @@ NodeMonitorHandler::AttrChanged(ino_t node, dev_t device)
|
||||
|
||||
/* virtual */ void
|
||||
NodeMonitorHandler::DeviceMounted(dev_t new_device, dev_t device,
|
||||
ino_t directory)
|
||||
ino_t directory)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
@@ -161,15 +163,17 @@ NodeMonitorHandler::HandleEntryCreated(BMessage * msg)
|
||||
status_t
|
||||
NodeMonitorHandler::HandleEntryRemoved(BMessage * msg)
|
||||
{
|
||||
const char *name;
|
||||
ino_t directory;
|
||||
dev_t device;
|
||||
ino_t node;
|
||||
if ((msg->FindInt64("directory", &directory) != B_OK) ||
|
||||
if ((msg->FindString("name", &name) != B_OK) ||
|
||||
(msg->FindInt64("directory", &directory) != B_OK) ||
|
||||
(msg->FindInt32("device", &device) != B_OK) ||
|
||||
(msg->FindInt64("node", &node) != B_OK)) {
|
||||
return B_MESSAGE_NOT_UNDERSTOOD;
|
||||
}
|
||||
EntryRemoved(directory, device, node);
|
||||
EntryRemoved(name, directory, device, node);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -178,18 +182,23 @@ status_t
|
||||
NodeMonitorHandler::HandleEntryMoved(BMessage * msg)
|
||||
{
|
||||
const char *name;
|
||||
const char *fromName;
|
||||
ino_t from_directory;
|
||||
ino_t to_directory;
|
||||
dev_t device;
|
||||
ino_t node;
|
||||
dev_t deviceNode;
|
||||
if ((msg->FindString("name", &name) != B_OK) ||
|
||||
(msg->FindInt64("from directory", &from_directory) != B_OK) ||
|
||||
(msg->FindString("from name", &fromName) != B_OK) ||
|
||||
(msg->FindInt64("from directory", &from_directory) != B_OK) ||
|
||||
(msg->FindInt64("to directory", &to_directory) != B_OK) ||
|
||||
(msg->FindInt32("device", &device) != B_OK) ||
|
||||
(msg->FindInt32("node device", &deviceNode) != B_OK) ||
|
||||
(msg->FindInt64("node", &node) != B_OK)) {
|
||||
return B_MESSAGE_NOT_UNDERSTOOD;
|
||||
}
|
||||
EntryMoved(name, from_directory, to_directory, device, node);
|
||||
EntryMoved(name, fromName, from_directory, to_directory, device, node,
|
||||
deviceNode);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user