more of the same (store dir in an attribute, so it's easier to navigate)
perhaps all "key" data should be in attributes; it's a clean distinction, and we rarely have more than one key (at most 3 for edits)
This commit is contained in:
@@ -605,7 +605,7 @@ XNode* Profile::SaveSongScoresCreateNode() const
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
LPXNode pSongNode = pNode->AppendChild( "Song" );
|
LPXNode pSongNode = pNode->AppendChild( "Song" );
|
||||||
pSongNode->AppendChild( "SongDir", pSong->GetSongDir() );
|
pSongNode->AppendAttr( "Dir", pSong->GetSongDir() );
|
||||||
|
|
||||||
const vector<Steps*> vSteps = pSong->GetAllSteps();
|
const vector<Steps*> vSteps = pSong->GetAllSteps();
|
||||||
|
|
||||||
@@ -644,9 +644,10 @@ void Profile::LoadSongScoresFromNode( const XNode* pNode )
|
|||||||
if( (*song)->name != "Song" )
|
if( (*song)->name != "Song" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CString sSongDir;
|
const LPXAttr TypeAttr = (*song)->GetAttr( "Dir" );
|
||||||
if( !(*song)->GetChildValue("SongDir", sSongDir) )
|
if( TypeAttr == NULL )
|
||||||
WARN_AND_CONTINUE;
|
WARN_AND_CONTINUE;
|
||||||
|
const CString sSongDir = TypeAttr->value;
|
||||||
|
|
||||||
Song* pSong = SONGMAN->GetSongFromDir( sSongDir );
|
Song* pSong = SONGMAN->GetSongFromDir( sSongDir );
|
||||||
if( pSong == NULL )
|
if( pSong == NULL )
|
||||||
|
|||||||
Reference in New Issue
Block a user