diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index 92bc77d8f8..901c395914 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -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" ); diff --git a/stepmania/src/Profile.h b/stepmania/src/Profile.h index 21433c8ce0..a1b770b34c 100644 --- a/stepmania/src/Profile.h +++ b/stepmania/src/Profile.h @@ -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 ); diff --git a/stepmania/src/ProfileManager.cpp b/stepmania/src/ProfileManager.cpp index f644026d58..707696675f 100644 --- a/stepmania/src/ProfileManager.cpp +++ b/stepmania/src/ProfileManager.cpp @@ -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(); diff --git a/stepmania/src/ProfileManager.h b/stepmania/src/ProfileManager.h index 757643543f..b6f12f3a69 100644 --- a/stepmania/src/ProfileManager.h +++ b/stepmania/src/ProfileManager.h @@ -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 ); diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index b378195792..4a3fbc5368 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -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, vectorMount( "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 ); } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp index a3e0c0683b..aed40a639a 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp @@ -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, vectorMount( "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 );