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

Merge branch 'master' into thqsqlite

This commit is contained in:
Jeff Mitchell 2012-06-18 04:22:47 -04:00
commit 8a61e89d83

View File

@ -194,13 +194,13 @@ 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;
}
QString nodeid = property( "nodeid" ).toString();
QString bareName = name().left( name().indexOf( "/" ) );
QString bareName = name().contains( '/' ) ? name().left( name().indexOf( "/" ) ) : name();
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking ACL for" << name();
connect( ACLRegistry::instance(), SIGNAL( aclResult( QString, QString, ACLRegistry::ACL ) ), this, SLOT( checkACLResult( QString, QString, ACLRegistry::ACL ) ), Qt::QueuedConnection );
QMetaObject::invokeMethod( ACLRegistry::instance(), "isAuthorizedUser", Qt::QueuedConnection, Q_ARG( QString, nodeid ), Q_ARG( QString, bareName ), Q_ARG( ACLRegistry::ACL, ACLRegistry::NotFound ) );
@ -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;