move FastLoadProfileNameFromMemoryCard into ProfileManager
This commit is contained in:
@@ -1018,16 +1018,6 @@ Profile::LoadResult Profile::LoadEditableDataFromDir( CString sDir )
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName )
|
|
||||||
{
|
|
||||||
CString sProfileDir = sDir + PREFSMAN->m_sMemoryCardProfileSubdir + '/';
|
|
||||||
|
|
||||||
Profile profile;
|
|
||||||
profile.LoadEditableDataFromDir( sProfileDir );
|
|
||||||
sName = profile.GetDisplayName();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
void Profile::LoadGeneralDataFromNode( const XNode* pNode )
|
||||||
{
|
{
|
||||||
ASSERT( pNode->m_sName == "GeneralData" );
|
ASSERT( pNode->m_sName == "GeneralData" );
|
||||||
|
|||||||
@@ -283,7 +283,6 @@ public:
|
|||||||
bool SaveAllToDir( CString sDir, bool bSignData ) const;
|
bool SaveAllToDir( CString sDir, bool bSignData ) const;
|
||||||
|
|
||||||
LoadResult LoadEditableDataFromDir( CString sDir );
|
LoadResult LoadEditableDataFromDir( CString sDir );
|
||||||
static bool FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName );
|
|
||||||
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
|
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
|
||||||
void LoadGeneralDataFromNode( const XNode* pNode );
|
void LoadGeneralDataFromNode( const XNode* pNode );
|
||||||
void LoadSongScoresFromNode( const XNode* pNode );
|
void LoadSongScoresFromNode( const XNode* pNode );
|
||||||
|
|||||||
@@ -196,6 +196,17 @@ bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ProfileManager::FastLoadProfileNameFromMemoryCard( CString sRootDir, CString &sName ) const
|
||||||
|
{
|
||||||
|
CString sProfileDir = sRootDir + PREFSMAN->m_sMemoryCardProfileSubdir + '/';
|
||||||
|
|
||||||
|
Profile profile;
|
||||||
|
profile.LoadEditableDataFromDir( sProfileDir );
|
||||||
|
sName = profile.GetDisplayName();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void ProfileManager::SaveAllProfiles() const
|
void ProfileManager::SaveAllProfiles() const
|
||||||
{
|
{
|
||||||
this->SaveMachineProfile();
|
this->SaveMachineProfile();
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public:
|
|||||||
bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile
|
bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile
|
||||||
bool LoadLocalProfileFromMachine( PlayerNumber pn );
|
bool LoadLocalProfileFromMachine( PlayerNumber pn );
|
||||||
bool LoadProfileFromMemoryCard( PlayerNumber pn );
|
bool LoadProfileFromMemoryCard( PlayerNumber pn );
|
||||||
|
bool FastLoadProfileNameFromMemoryCard( CString sRootDir, CString &sName ) const;
|
||||||
void SaveAllProfiles() const;
|
void SaveAllProfiles() const;
|
||||||
bool SaveProfile( PlayerNumber pn ) const;
|
bool SaveProfile( PlayerNumber pn ) const;
|
||||||
void UnloadProfile( PlayerNumber pn );
|
void UnloadProfile( PlayerNumber pn );
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
#include "Profile.h"
|
#include "ProfileManager.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ bool MemoryCardDriverThreaded_Linux::DoOneUpdate( bool bMount, vector<UsbStorage
|
|||||||
d.m_State = UsbStorageDevice::STATE_READY;
|
d.m_State = UsbStorageDevice::STATE_READY;
|
||||||
|
|
||||||
FILEMAN->Mount( "dir", d.sOsMountDir, TEMP_MOUNT_POINT );
|
FILEMAN->Mount( "dir", d.sOsMountDir, TEMP_MOUNT_POINT );
|
||||||
d.bIsNameAvailable = Profile::FastLoadProfileNameFromMemoryCard( TEMP_MOUNT_POINT, d.sName );
|
d.bIsNameAvailable = PROFILEMAN->FastLoadProfileNameFromMemoryCard( TEMP_MOUNT_POINT, d.sName );
|
||||||
FILEMAN->Unmount( "dir", d.sOsMountDir, TEMP_MOUNT_POINT );
|
FILEMAN->Unmount( "dir", d.sOsMountDir, TEMP_MOUNT_POINT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "Profile.h"
|
#include "ProfileManager.h"
|
||||||
#include "PrefsManager.h"
|
#include "PrefsManager.h"
|
||||||
|
|
||||||
const CString TEMP_MOUNT_POINT_INTERNAL = "@mctemp/";
|
const CString TEMP_MOUNT_POINT_INTERNAL = "@mctemp/";
|
||||||
@@ -99,7 +99,7 @@ bool MemoryCardDriverThreaded_Windows::DoOneUpdate( bool bMount, vector<UsbStora
|
|||||||
FILEMAN->Mount( "dir", usbd.sOsMountDir, TEMP_MOUNT_POINT_INTERNAL );
|
FILEMAN->Mount( "dir", usbd.sOsMountDir, TEMP_MOUNT_POINT_INTERNAL );
|
||||||
FILEMAN->Mount( "timeout", TEMP_MOUNT_POINT_INTERNAL, TEMP_MOUNT_POINT );
|
FILEMAN->Mount( "timeout", TEMP_MOUNT_POINT_INTERNAL, TEMP_MOUNT_POINT );
|
||||||
|
|
||||||
usbd.bIsNameAvailable = Profile::FastLoadProfileNameFromMemoryCard( TEMP_MOUNT_POINT, usbd.sName );
|
usbd.bIsNameAvailable = PROFILEMAN->FastLoadProfileNameFromMemoryCard( TEMP_MOUNT_POINT, usbd.sName );
|
||||||
|
|
||||||
FILEMAN->Unmount( "timeout", TEMP_MOUNT_POINT_INTERNAL, TEMP_MOUNT_POINT );
|
FILEMAN->Unmount( "timeout", TEMP_MOUNT_POINT_INTERNAL, TEMP_MOUNT_POINT );
|
||||||
FILEMAN->Unmount( "dir", usbd.sOsMountDir, TEMP_MOUNT_POINT_INTERNAL );
|
FILEMAN->Unmount( "dir", usbd.sOsMountDir, TEMP_MOUNT_POINT_INTERNAL );
|
||||||
|
|||||||
Reference in New Issue
Block a user