1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 01:00:13 +02:00

We have introduced a third valid state but did not add the check for it.

This commit is contained in:
Uwe L. Korn
2013-09-18 19:31:21 +02:00
parent 16c5bbee85
commit abbc6eefc3

View File

@@ -94,15 +94,17 @@ SipInfo::clear()
bool bool
SipInfo::isValid() const SipInfo::isValid() const
{ {
// tDebug() << Q_FUNC_INFO << d->visible << d->host << d->port << d->nodeId << d->key; tDebug( LOGVERBOSE ) << Q_FUNC_INFO << d->visible << d->host << d->port << d->nodeId << d->key;
if ( !d->visible.isNull() ) if ( !d->visible.isNull() )
{ {
if ( // visible and all data available
// visible and all data available if ( d->visible.toBool() && !d->host.isEmpty() && ( d->port > 0 ) && !d->nodeId.isNull() && !d->key.isNull() )
( d->visible.toBool() && !d->host.isEmpty() && ( d->port > 0 ) && !d->nodeId.isNull() && !d->key.isNull() ) return true;
// invisible and no data available // invisible and no data available
|| ( !d->visible.toBool() && d->host.isEmpty() && ( d->port < 0 ) && d->nodeId.isNull() && d->key.isNull() ) if ( !d->visible.toBool() && d->host.isEmpty() && ( d->port < 0 ) && d->nodeId.isNull() && d->key.isNull() )
) return true;
// invisible and but nodeId and key available
if ( !d->visible.toBool() && d->host.isEmpty() && ( d->port < 0 ) && !d->nodeId.isNull() && !d->key.isNull() )
return true; return true;
} }