mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
Merge branch 'master' into thqsqlite
This commit is contained in:
@@ -194,13 +194,13 @@ Connection::checkACL()
|
|||||||
{
|
{
|
||||||
if ( !property( "nodeid" ).isValid() )
|
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() ) );
|
QTimer::singleShot( 0, this, SLOT( doSetup() ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString nodeid = property( "nodeid" ).toString();
|
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();
|
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 );
|
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 ) );
|
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
|
void
|
||||||
Connection::checkACLResult( const QString &nodeid, const QString &username, ACLRegistry::ACL peerStatus )
|
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;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
disconnect( ACLRegistry::instance(), SIGNAL( aclResult( QString, QString, ACLRegistry::ACL ) ) );
|
disconnect( ACLRegistry::instance(), SIGNAL( aclResult( QString, QString, ACLRegistry::ACL ) ) );
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "ACL status is" << peerStatus;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "ACL status is" << peerStatus;
|
||||||
|
Reference in New Issue
Block a user