QueryParser: Don't send notifications if the node's been deleted.
Gets rid of redundant messages under B_QUERY_WATCH_ALL.
This commit is contained in:
@@ -1660,6 +1660,10 @@ Query<QueryPolicy>::_EvaluateLiveUpdate(Entry* entry, Node* node, const char* at
|
|||||||
// entry was removed
|
// entry was removed
|
||||||
opcode = B_ENTRY_REMOVED;
|
opcode = B_ENTRY_REMOVED;
|
||||||
} else if ((fFlags & B_QUERY_WATCH_ALL) != 0) {
|
} else if ((fFlags & B_QUERY_WATCH_ALL) != 0) {
|
||||||
|
if (QueryPolicy::NodeIsDeleted(node)) {
|
||||||
|
// don't notify
|
||||||
|
return;
|
||||||
|
}
|
||||||
// still in query, all attribute changes watched
|
// still in query, all attribute changes watched
|
||||||
opcode = B_ATTR_CHANGED;
|
opcode = B_ATTR_CHANGED;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -283,6 +283,11 @@ struct Query::QueryPolicy {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool NodeIsDeleted(Node* node)
|
||||||
|
{
|
||||||
|
return node->IsDeleted();
|
||||||
|
}
|
||||||
|
|
||||||
// Volume interface
|
// Volume interface
|
||||||
|
|
||||||
static dev_t ContextGetVolumeID(Context* context)
|
static dev_t ContextGetVolumeID(Context* context)
|
||||||
|
|||||||
@@ -220,6 +220,11 @@ struct Query::QueryPolicy {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool NodeIsDeleted(Node* node)
|
||||||
|
{
|
||||||
|
return node->GetParentUnchecked() == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Volume interface
|
// Volume interface
|
||||||
|
|
||||||
static dev_t ContextGetVolumeID(Context* context)
|
static dev_t ContextGetVolumeID(Context* context)
|
||||||
|
|||||||
@@ -276,6 +276,11 @@ struct Query::QueryPolicy {
|
|||||||
return node->GetNextReferrer(entry);
|
return node->GetNextReferrer(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool NodeIsDeleted(Node* node)
|
||||||
|
{
|
||||||
|
return node->GetFirstReferrer() == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Volume interface
|
// Volume interface
|
||||||
|
|
||||||
static dev_t ContextGetVolumeID(Context* context)
|
static dev_t ContextGetVolumeID(Context* context)
|
||||||
|
|||||||
Reference in New Issue
Block a user