1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 23:39:42 +01:00

Fix checking result of ACL against name

This commit is contained in:
Jeff Mitchell 2012-06-18 03:35:24 -04:00
parent 0383378385
commit b88be39f54

View File

@ -194,7 +194,7 @@ Connection::checkACL()
{
if ( !property( "nodeid" ).isValid() )
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Not checking ACL, nodeid is empty";
tLog() << Q_FUNC_INFO << "Not checking ACL, nodeid is empty";
QTimer::singleShot( 0, this, SLOT( doSetup() ) );
return;
}
@ -210,8 +210,12 @@ Connection::checkACL()
void
Connection::checkACLResult( const QString &nodeid, const QString &username, ACLRegistry::ACL peerStatus )
{
if ( nodeid != property( "nodeid" ).toString() || username != name() )
QString bareName = name().contains( '/' ) ? name().left( name().indexOf( "/" ) ) : name();
if ( nodeid != property( "nodeid" ).toString() || username != bareName )
{
tLog() << Q_FUNC_INFO << "nodeid not ours, or username not our barename";
return;
}
disconnect( ACLRegistry::instance(), SIGNAL( aclResult( QString, QString, ACLRegistry::ACL ) ) );
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "ACL status is" << peerStatus;