move FastLoadProfileNameFromMemoryCard into ProfileManager

This commit is contained in:
Glenn Maynard
2005-04-24 23:06:15 +00:00
parent 9928ed6bde
commit 1ea1ecfaaf
6 changed files with 16 additions and 15 deletions
-10
View File
@@ -1018,16 +1018,6 @@ Profile::LoadResult Profile::LoadEditableDataFromDir( CString sDir )
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 )
{
ASSERT( pNode->m_sName == "GeneralData" );
-1
View File
@@ -283,7 +283,6 @@ public:
bool SaveAllToDir( CString sDir, bool bSignData ) const;
LoadResult LoadEditableDataFromDir( CString sDir );
static bool FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName );
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
void LoadGeneralDataFromNode( const XNode* pNode );
void LoadSongScoresFromNode( const XNode* pNode );
+11
View File
@@ -196,6 +196,17 @@ bool ProfileManager::LoadFirstAvailableProfile( PlayerNumber pn )
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
{
this->SaveMachineProfile();
+1
View File
@@ -29,6 +29,7 @@ public:
bool LoadFirstAvailableProfile( PlayerNumber pn ); // memory card or local profile
bool LoadLocalProfileFromMachine( PlayerNumber pn );
bool LoadProfileFromMemoryCard( PlayerNumber pn );
bool FastLoadProfileNameFromMemoryCard( CString sRootDir, CString &sName ) const;
void SaveAllProfiles() const;
bool SaveProfile( PlayerNumber pn ) const;
void UnloadProfile( PlayerNumber pn );
@@ -3,7 +3,7 @@
#include "RageLog.h"
#include "RageUtil.h"
#include "RageFileManager.h"
#include "Profile.h"
#include "ProfileManager.h"
#include "PrefsManager.h"
#include "Foreach.h"
@@ -238,7 +238,7 @@ bool MemoryCardDriverThreaded_Linux::DoOneUpdate( bool bMount, vector<UsbStorage
d.m_State = UsbStorageDevice::STATE_READY;
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 );
}
@@ -3,7 +3,7 @@
#include "RageUtil.h"
#include "RageFileManager.h"
#include "RageLog.h"
#include "Profile.h"
#include "ProfileManager.h"
#include "PrefsManager.h"
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( "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( "dir", usbd.sOsMountDir, TEMP_MOUNT_POINT_INTERNAL );