Leave Save in Application Support, put Cache and Logs in Library, and put screenshots in Documents/PRODUCT_ID Screenshots.
This commit is contained in:
@@ -305,6 +305,16 @@ int64_t ArchHooks::GetMicrosecondsSinceStart( bool bAccurate )
|
|||||||
|
|
||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
|
|
||||||
|
static void PathForFolderType( char dir[PATH_MAX], OSType folderType )
|
||||||
|
{
|
||||||
|
FSRef fs;
|
||||||
|
|
||||||
|
if( FSFindFolder(kUserDomain, folderType, kDontCreateFolder, &fs) )
|
||||||
|
FAIL_M( ssprintf("FSFindFolder(%lu) failed.", folderType) );
|
||||||
|
if( FSRefMakePath(&fs, (UInt8 *)dir, PATH_MAX) )
|
||||||
|
FAIL_M( "FSRefMakePath() failed." );
|
||||||
|
}
|
||||||
|
|
||||||
void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
|
void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
|
||||||
{
|
{
|
||||||
CFBundleRef bundle = CFBundleGetMainBundle();
|
CFBundleRef bundle = CFBundleGetMainBundle();
|
||||||
@@ -318,18 +328,21 @@ void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
|
|||||||
CFRelease( dirURL );
|
CFRelease( dirURL );
|
||||||
FILEMAN->Mount( "dir", dir, "/" );
|
FILEMAN->Mount( "dir", dir, "/" );
|
||||||
|
|
||||||
FSRef fs; // This does not need to be "released" by the file manager
|
// /Save -> ~/Library/Application Support/PRODUCT_ID
|
||||||
|
PathForFolderType( dir, kApplicationSupportFolderType );
|
||||||
|
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID, dir), "/Save" );
|
||||||
|
|
||||||
// This returns the absolute path for ~/Library/Application Support
|
// /Screenshots -> ~/Documents/PRODUCT_ID Screenshots
|
||||||
if( FSFindFolder(kUserDomain, kApplicationSupportFolderType, kDontCreateFolder, &fs) )
|
PathForFolderType( dir, kDocumentsFolderType );
|
||||||
FAIL_M( "FSFindFolder() failed." );
|
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID " Screenshots", dir), "/Screenshots" );
|
||||||
if( FSRefMakePath(&fs, (UInt8 *)dir, sizeof(dir)) )
|
|
||||||
FAIL_M( "FSRefMakePath() failed." );
|
// /Cache -> ~/Library/Caches/PRODUCT_ID
|
||||||
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID "/Save", dir), "/Save" );
|
PathForFolderType( dir, kCachedDataFolderType );
|
||||||
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID "/Screenshots", dir), "/Screenshots" );
|
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID, dir), "/Cache" );
|
||||||
/* The Cache directory should probably go in ~/Library/Caches/bundle_identifier/Cache but
|
|
||||||
* why bother we're already using ~/Library/Application Support/PRODUCT_ID. */
|
// /Logs -> ~/Library/Logs/PRODUCT_ID
|
||||||
FILEMAN->Mount( "dir", ssprintf("%s/" PRODUCT_ID "/Cache", dir), "/Cache" );
|
PathForFolderType( dir, kDomainLibraryFolderType );
|
||||||
|
FILEMAN->Mount( "dir", ssprintf("%s/Logs/" PRODUCT_ID, dir), "/Logs" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user