util: add isConnected() in signal::Connection and signal::ScopedConnection
Change-Id: Iddf2a084ccf137a691cd85c54003182acf0e5afd
Refs: #2308
diff --git a/src/util/signal-connection.cpp b/src/util/signal-connection.cpp
index 8660e4d..7c74246 100644
--- a/src/util/signal-connection.cpp
+++ b/src/util/signal-connection.cpp
@@ -46,6 +46,12 @@
}
bool
+Connection::isConnected() const
+{
+ return !m_disconnect.expired();
+}
+
+bool
Connection::operator==(const Connection& other) const
{
shared_ptr<function<void()>> f1 = m_disconnect.lock();