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:
|
protected:
|
||||||
virtual void EntryCreated(const char* name, ino_t directory,
|
virtual void EntryCreated(const char* name, ino_t directory,
|
||||||
dev_t device, ino_t node);
|
dev_t device, ino_t node);
|
||||||
virtual void EntryRemoved(ino_t directory, dev_t device,
|
virtual void EntryRemoved(const char *name, ino_t directory,
|
||||||
ino_t node);
|
|
||||||
virtual void EntryMoved(const char* name,
|
|
||||||
ino_t fromDirectory, ino_t toDirectory,
|
|
||||||
dev_t device, ino_t node);
|
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 StatChanged(ino_t node, dev_t device);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -27,14 +27,16 @@ static void make_node_ref(dev_t device, ino_t node, node_ref * ref);
|
|||||||
protected:
|
protected:
|
||||||
// hooks for subclass
|
// hooks for subclass
|
||||||
virtual void EntryCreated(const char *name, ino_t directory,
|
virtual void EntryCreated(const char *name, ino_t directory,
|
||||||
dev_t device, ino_t node);
|
dev_t device, ino_t node);
|
||||||
virtual void EntryRemoved(ino_t directory, dev_t device, ino_t node);
|
virtual void EntryRemoved(const char *name, ino_t directory,
|
||||||
virtual void EntryMoved(const char *name, ino_t from_directory,
|
dev_t device, ino_t node);
|
||||||
ino_t to_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 StatChanged(ino_t node, dev_t device);
|
||||||
virtual void AttrChanged(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,
|
virtual void DeviceMounted(dev_t new_device, dev_t device,
|
||||||
ino_t directory);
|
ino_t directory);
|
||||||
virtual void DeviceUnmounted(dev_t new_device);
|
virtual void DeviceUnmounted(dev_t new_device);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ AddOnMonitorHandler::EntryCreated(const char* name, ino_t directory,
|
|||||||
|
|
||||||
|
|
||||||
void
|
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;
|
node_ref entryNodeRef;
|
||||||
make_node_ref(device, node, &entryNodeRef);
|
make_node_ref(device, node, &entryNodeRef);
|
||||||
@@ -212,15 +213,16 @@ AddOnMonitorHandler::EntryRemoved(ino_t directory, dev_t device, ino_t node)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
AddOnMonitorHandler::EntryMoved(const char* name, ino_t fromDirectory,
|
AddOnMonitorHandler::EntryMoved(const char *name, const char *fromName,
|
||||||
ino_t toDirectory, dev_t device, ino_t node)
|
ino_t from_directory, ino_t to_directory, dev_t device, ino_t node,
|
||||||
|
dev_t nodeDevice)
|
||||||
{
|
{
|
||||||
node_ref toNodeRef;
|
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
|
// Search the "from" and "to" directory in the known directories
|
||||||
DirectoryList::iterator from_iter = fDirectories.begin();
|
DirectoryList::iterator from_iter = fDirectories.begin();
|
||||||
bool watchingFromDirectory = _FindDirectory(fromDirectory, device,
|
bool watchingFromDirectory = _FindDirectory(from_directory, device,
|
||||||
from_iter);
|
from_iter);
|
||||||
|
|
||||||
DirectoryList::iterator to_iter = fDirectories.begin();
|
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
|
// 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
|
// which should in fact stay hidden (moving add-on from home to common
|
||||||
// folder or vice versa, the system add-on should remain hidden).
|
// 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;
|
info.dir_nref = toNodeRef;
|
||||||
_EntryCreated(info);
|
_EntryCreated(info);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -86,22 +86,24 @@ NodeMonitorHandler::MessageReceived(BMessage * msg)
|
|||||||
|
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
NodeMonitorHandler::EntryCreated(const char *name, ino_t directory,
|
NodeMonitorHandler::EntryCreated(const char *name, ino_t directory,
|
||||||
dev_t device, ino_t node)
|
dev_t device, ino_t node)
|
||||||
{
|
{
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* virtual */ void
|
/* 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
|
// ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
NodeMonitorHandler::EntryMoved(const char *name, ino_t from_directory,
|
NodeMonitorHandler::EntryMoved(const char *name, const char *fromName,
|
||||||
ino_t to_directory, dev_t device, ino_t node)
|
ino_t from_directory, ino_t to_directory, dev_t device,ino_t node,
|
||||||
|
dev_t nodeDevice)
|
||||||
{
|
{
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
@@ -123,7 +125,7 @@ NodeMonitorHandler::AttrChanged(ino_t node, dev_t device)
|
|||||||
|
|
||||||
/* virtual */ void
|
/* virtual */ void
|
||||||
NodeMonitorHandler::DeviceMounted(dev_t new_device, dev_t device,
|
NodeMonitorHandler::DeviceMounted(dev_t new_device, dev_t device,
|
||||||
ino_t directory)
|
ino_t directory)
|
||||||
{
|
{
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
@@ -161,15 +163,17 @@ NodeMonitorHandler::HandleEntryCreated(BMessage * msg)
|
|||||||
status_t
|
status_t
|
||||||
NodeMonitorHandler::HandleEntryRemoved(BMessage * msg)
|
NodeMonitorHandler::HandleEntryRemoved(BMessage * msg)
|
||||||
{
|
{
|
||||||
|
const char *name;
|
||||||
ino_t directory;
|
ino_t directory;
|
||||||
dev_t device;
|
dev_t device;
|
||||||
ino_t node;
|
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->FindInt32("device", &device) != B_OK) ||
|
||||||
(msg->FindInt64("node", &node) != B_OK)) {
|
(msg->FindInt64("node", &node) != B_OK)) {
|
||||||
return B_MESSAGE_NOT_UNDERSTOOD;
|
return B_MESSAGE_NOT_UNDERSTOOD;
|
||||||
}
|
}
|
||||||
EntryRemoved(directory, device, node);
|
EntryRemoved(name, directory, device, node);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,18 +182,23 @@ status_t
|
|||||||
NodeMonitorHandler::HandleEntryMoved(BMessage * msg)
|
NodeMonitorHandler::HandleEntryMoved(BMessage * msg)
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
const char *fromName;
|
||||||
ino_t from_directory;
|
ino_t from_directory;
|
||||||
ino_t to_directory;
|
ino_t to_directory;
|
||||||
dev_t device;
|
dev_t device;
|
||||||
ino_t node;
|
ino_t node;
|
||||||
|
dev_t deviceNode;
|
||||||
if ((msg->FindString("name", &name) != B_OK) ||
|
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->FindInt64("to directory", &to_directory) != B_OK) ||
|
||||||
(msg->FindInt32("device", &device) != B_OK) ||
|
(msg->FindInt32("device", &device) != B_OK) ||
|
||||||
|
(msg->FindInt32("node device", &deviceNode) != B_OK) ||
|
||||||
(msg->FindInt64("node", &node) != B_OK)) {
|
(msg->FindInt64("node", &node) != B_OK)) {
|
||||||
return B_MESSAGE_NOT_UNDERSTOOD;
|
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;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user