InternalPeer may be closed legitimately like any other peer type.
Although for InternalPeer this just sets a flag, it should not
produce a warning claiming that the method is not implemented.
Also actually report the open status for InternalPeer. Ensure that
it is constructed in open state, otherwise a signalproxy cannot
be set.
bool InternalPeer::isOpen() const
{
- return true;
+ return _isOpen;
}
void InternalPeer::close(const QString &reason)
{
- // FIXME
- Q_UNUSED(reason)
- qWarning() << "closing not implemented!";
+ Q_UNUSED(reason);
+ _isOpen = false;
}
if (proxy && !_proxy) {
_proxy = proxy;
+ _isOpen = true;
return;
}
private:
SignalProxy *_proxy{nullptr};
- bool _isOpen{false};
+ bool _isOpen{true};
};
Q_DECLARE_METATYPE(QPointer<InternalPeer>)