mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
Windows-specific handling
This commit is contained in:
@@ -51,6 +51,8 @@ public:
|
|||||||
{
|
{
|
||||||
Q_ASSERT( !m_resolverId.isEmpty() );
|
Q_ASSERT( !m_resolverId.isEmpty() );
|
||||||
Q_ASSERT( !m_manager.isNull() );
|
Q_ASSERT( !m_manager.isNull() );
|
||||||
|
|
||||||
|
setProperty( "resolverid", m_resolverId );
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~BinaryInstallerHelper() {}
|
virtual ~BinaryInstallerHelper() {}
|
||||||
@@ -407,10 +409,6 @@ AtticaManager::binaryResolversList( BaseJob* j )
|
|||||||
platform = "win";
|
platform = "win";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// NOTE HACK
|
|
||||||
// At the moment we are going to assume that all binary resolvers also have an associated full-fledged Tomahawk Account
|
|
||||||
// like SpotifyAccount.
|
|
||||||
|
|
||||||
foreach ( const Content& c, binaryResolvers )
|
foreach ( const Content& c, binaryResolvers )
|
||||||
{
|
{
|
||||||
if ( !c.attribute( "typeid" ).isEmpty() && c.attribute( "typeid" ) == platform )
|
if ( !c.attribute( "typeid" ).isEmpty() && c.attribute( "typeid" ) == platform )
|
||||||
|
@@ -762,7 +762,6 @@ QString
|
|||||||
extractScriptPayload( const QString& filename, const QString& resolverId )
|
extractScriptPayload( const QString& filename, const QString& resolverId )
|
||||||
{
|
{
|
||||||
// uses QuaZip to extract the temporary zip file to the user's tomahawk data/resolvers directory
|
// uses QuaZip to extract the temporary zip file to the user's tomahawk data/resolvers directory
|
||||||
|
|
||||||
QDir resolverDir = appDataDir();
|
QDir resolverDir = appDataDir();
|
||||||
if ( !resolverDir.mkpath( QString( "atticaresolvers/%1" ).arg( resolverId ) ) )
|
if ( !resolverDir.mkpath( QString( "atticaresolvers/%1" ).arg( resolverId ) ) )
|
||||||
{
|
{
|
||||||
@@ -853,6 +852,8 @@ extractBinaryResolver( const QString& zipFilename, QObject* receiver )
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
// Platform-specific handling of resolver payload now. We know it's good
|
||||||
// Unzip the file.
|
// Unzip the file.
|
||||||
QFileInfo info( zipFilename );
|
QFileInfo info( zipFilename );
|
||||||
QDir tmpDir = QDir::tempPath();
|
QDir tmpDir = QDir::tempPath();
|
||||||
@@ -864,8 +865,6 @@ extractBinaryResolver( const QString& zipFilename, QObject* receiver )
|
|||||||
tmpDir.cd( info.baseName() );
|
tmpDir.cd( info.baseName() );
|
||||||
TomahawkUtils::unzipFileInFolder( info.absoluteFilePath(), tmpDir );
|
TomahawkUtils::unzipFileInFolder( info.absoluteFilePath(), tmpDir );
|
||||||
|
|
||||||
// Platform-specific handling of resolver payload now. We know it's good and we unzipped it
|
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
// On OSX it just contains 1 file, the resolver executable itself. For now. We just copy it to
|
// On OSX it just contains 1 file, the resolver executable itself. For now. We just copy it to
|
||||||
// the Tomahawk.app/Contents/MacOS/ folder alongside the Tomahawk executable.
|
// the Tomahawk.app/Contents/MacOS/ folder alongside the Tomahawk executable.
|
||||||
const QString dest = QCoreApplication::applicationDirPath();
|
const QString dest = QCoreApplication::applicationDirPath();
|
||||||
@@ -879,6 +878,20 @@ extractBinaryResolver( const QString& zipFilename, QObject* receiver )
|
|||||||
|
|
||||||
copyWithAuthentication( src, dest, receiver );
|
copyWithAuthentication( src, dest, receiver );
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
|
// We unzip directly to the target location, just like normal attica resolvers
|
||||||
|
Q_ASSERT( receiver );
|
||||||
|
if ( !receiver )
|
||||||
|
return;
|
||||||
|
|
||||||
|
const QString resolverId = receiver->property( "resolverid" ).toString();
|
||||||
|
|
||||||
|
Q_ASSERT( !resolverId.isEmpty() );
|
||||||
|
if ( resolverId.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
const QString resolverDir = extractScriptPayload( zipFilename, resolverId );
|
||||||
|
QMetaObject::invokeMethod(receiver, "installSucceeded", Qt::DirectConnection, Q_ARG( QString, path ) );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// No support for binary resolvers on linux! Shouldn't even have been allowed to see/install..
|
// No support for binary resolvers on linux! Shouldn't even have been allowed to see/install..
|
||||||
|
Reference in New Issue
Block a user