mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
Go back to previous setNam, but functionality should really be identical.
This commit is contained in:
parent
b325d9bf0f
commit
e0177ed895
@ -605,15 +605,7 @@ nam()
|
||||
return s_threadNamHash[ QThread::currentThread() ];
|
||||
|
||||
if ( !s_threadNamHash.contains( TOMAHAWK_APPLICATION::instance()->thread() ) )
|
||||
{
|
||||
if ( QThread::currentThread() == TOMAHAWK_APPLICATION::instance()->thread() )
|
||||
{
|
||||
setNam( new QNetworkAccessManager(), true );
|
||||
return s_threadNamHash[ QThread::currentThread() ];
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
||||
// Create a nam for this thread based on the main thread's settings but with its own proxyfactory
|
||||
QNetworkAccessManager *mainNam = s_threadNamHash[ TOMAHAWK_APPLICATION::instance()->thread() ];
|
||||
@ -630,12 +622,11 @@ nam()
|
||||
|
||||
|
||||
void
|
||||
setNam( QNetworkAccessManager* nam, bool noMutexLocker )
|
||||
setNam( QNetworkAccessManager* nam )
|
||||
{
|
||||
Q_ASSERT( nam );
|
||||
// Don't lock if being called from nam()()
|
||||
QMutex otherMutex;
|
||||
QMutexLocker locker( noMutexLocker ? &otherMutex : &s_namAccessMutex );
|
||||
QMutexLocker locker( &s_namAccessMutex );
|
||||
if ( !s_threadNamHash.contains( TOMAHAWK_APPLICATION::instance()->thread() ) &&
|
||||
QThread::currentThread() == TOMAHAWK_APPLICATION::instance()->thread() )
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ namespace TomahawkUtils
|
||||
DLLEXPORT QNetworkAccessManager* nam();
|
||||
|
||||
DLLEXPORT void setProxyFactory( TomahawkUtils::NetworkProxyFactory* factory, bool noMutexLocker = false );
|
||||
DLLEXPORT void setNam( QNetworkAccessManager* nam, bool noMutexLocker = false );
|
||||
DLLEXPORT void setNam( QNetworkAccessManager* nam );
|
||||
|
||||
DLLEXPORT QWidget* tomahawkWindow();
|
||||
/// Platform-specific bringing tomahawk mainwindow to front, b/c qt's activate() and such don't seem to work well enough for us
|
||||
|
@ -161,7 +161,7 @@ TomahawkApp::init()
|
||||
|
||||
tDebug( LOGINFO ) << "Setting NAM.";
|
||||
// Cause the creation of the nam, but don't need to address it directly, so prevent warning
|
||||
Q_UNUSED( TomahawkUtils::nam() );
|
||||
TomahawkUtils::setNam( new QNetworkAccessManager() );
|
||||
|
||||
m_audioEngine = QWeakPointer<AudioEngine>( new AudioEngine );
|
||||
m_scanManager = QWeakPointer<ScanManager>( new ScanManager( this ) );
|
||||
|
Loading…
x
Reference in New Issue
Block a user