mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-25 23:06:23 +02:00
fix compile on osx
don't use API that doesn't exist in snow leopard---same code is in liblastfmv1. if jono wants to rewrite the path detection code in snow leopard-compatible APIs, we can use that
This commit is contained in:
31
thirdparty/liblastfm2/src/core/misc.cpp
vendored
31
thirdparty/liblastfm2/src/core/misc.cpp
vendored
@@ -60,38 +60,7 @@ static QDir dataDotDot()
|
|||||||
return QDir::home();
|
return QDir::home();
|
||||||
|
|
||||||
#elif defined(Q_WS_MAC)
|
#elif defined(Q_WS_MAC)
|
||||||
|
|
||||||
#define EIT( x ) { OSErr err = x; if (err != noErr) throw 1; }
|
|
||||||
try
|
|
||||||
{
|
|
||||||
short vRefNum = 0;
|
|
||||||
long dirId;
|
|
||||||
EIT( ::FindFolder( kOnAppropriateDisk,
|
|
||||||
kApplicationSupportFolderType,
|
|
||||||
kDontCreateFolder,
|
|
||||||
&vRefNum,
|
|
||||||
&dirId ) );
|
|
||||||
|
|
||||||
// Now we have a vRefNum and a dirID - but *not* an Unix-Path as string.
|
|
||||||
// Lets make one based from this:
|
|
||||||
FSSpec fsspec;
|
|
||||||
EIT( ::FSMakeFSSpec( vRefNum, dirId, NULL, &fsspec ) );
|
|
||||||
|
|
||||||
// ...and build an FSRef based on thes FSSpec.
|
|
||||||
FSRef fsref;
|
|
||||||
EIT( ::FSpMakeFSRef( &fsspec, &fsref ) );
|
|
||||||
|
|
||||||
// ...then extract the Unix Path as a C-String from the FSRef
|
|
||||||
unsigned char path[512];
|
|
||||||
EIT( ::FSRefMakePath( &fsref, path, 512 ) );
|
|
||||||
|
|
||||||
return QDir::homePath() + QString::fromUtf8( (char*)path );
|
|
||||||
}
|
|
||||||
catch (int)
|
|
||||||
{
|
|
||||||
return QDir::home().filePath( "Library/Application Support" );
|
return QDir::home().filePath( "Library/Application Support" );
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined(Q_WS_X11)
|
#elif defined(Q_WS_X11)
|
||||||
return QDir::home().filePath( ".local/share" );
|
return QDir::home().filePath( ".local/share" );
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "MNetworkConnectionMonitor.h"
|
#include "MNetworkConnectionMonitor.h"
|
||||||
#include "ws/ws.h"
|
#include "../ws.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <SystemConfiguration/SCNetworkReachability.h>
|
#include <SystemConfiguration/SCNetworkReachability.h>
|
||||||
|
Reference in New Issue
Block a user