mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-25 20:33:20 +01:00
We have introduced a third valid state but did not add the check for it.
This commit is contained in:
parent
16c5bbee85
commit
abbc6eefc3
@ -94,15 +94,17 @@ SipInfo::clear()
|
||||
bool
|
||||
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 (
|
||||
// visible and all data available
|
||||
( d->visible.toBool() && !d->host.isEmpty() && ( d->port > 0 ) && !d->nodeId.isNull() && !d->key.isNull() )
|
||||
// invisible and no data available
|
||||
|| ( !d->visible.toBool() && d->host.isEmpty() && ( d->port < 0 ) && d->nodeId.isNull() && d->key.isNull() )
|
||||
)
|
||||
// visible and all data available
|
||||
if ( d->visible.toBool() && !d->host.isEmpty() && ( d->port > 0 ) && !d->nodeId.isNull() && !d->key.isNull() )
|
||||
return true;
|
||||
// invisible and no data available
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user