summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPetre Eftime <[email protected]>2016-01-15 16:44:35 +0200
committerPetre Eftime <[email protected]>2016-03-07 11:50:01 +0200
commit847f7a6ac405320df996d80067f83e4f5c10a74f (patch)
treea90d4a1f4162359a23aad1f1fbc415a9d2fd7882 /src
parent0ba4a05d825545cac19ec86c8336f7fbc779aaf6 (diff)
Add comparison for find's parent parameter
Signed-off-by: Petre Eftime <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/BluetoothManager.cpp6
-rw-r--r--src/BluetoothObject.cpp5
2 files changed, 10 insertions, 1 deletions
diff --git a/src/BluetoothManager.cpp b/src/BluetoothManager.cpp
index 5c606b15..42ff3429 100644
--- a/src/BluetoothManager.cpp
+++ b/src/BluetoothManager.cpp
@@ -212,7 +212,11 @@ void BluetoothManager::handle_event(BluetoothType type, std::string *name,
++it;
continue; /* this event does not match */
}
-
+ if ((*it)->get_parent() != NULL)
+ if (parent == NULL || *((*it)->get_parent()) != *parent) {
+ ++it;
+ continue; /* this event does not match */
+ }
/* The event matches, execute and see if it needs to reexecute */
if ((*it)->execute_callback(object))
it = event_list.erase(it);
diff --git a/src/BluetoothObject.cpp b/src/BluetoothObject.cpp
index 68960184..79c8b6e4 100644
--- a/src/BluetoothObject.cpp
+++ b/src/BluetoothObject.cpp
@@ -57,3 +57,8 @@ bool BluetoothObject::operator==(const BluetoothObject &other) const
return (this->get_bluetooth_type() == other.get_bluetooth_type())
&& (this->get_object_path() == other.get_object_path());
}
+
+bool BluetoothObject::operator!=(const BluetoothObject &other) const
+{
+ return !(*this == other);
+}