From e4ff8dd72520fe36d07e7455b1c0264d6b987f2f Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 22 Feb 2004 04:06:36 +0000 Subject: [PATCH] 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) --- stepmania/src/Profile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stepmania/src/Profile.cpp b/stepmania/src/Profile.cpp index d3c662d416..64085cfb0b 100644 --- a/stepmania/src/Profile.cpp +++ b/stepmania/src/Profile.cpp @@ -605,7 +605,7 @@ XNode* Profile::SaveSongScoresCreateNode() const continue; LPXNode pSongNode = pNode->AppendChild( "Song" ); - pSongNode->AppendChild( "SongDir", pSong->GetSongDir() ); + pSongNode->AppendAttr( "Dir", pSong->GetSongDir() ); const vector vSteps = pSong->GetAllSteps(); @@ -644,9 +644,10 @@ void Profile::LoadSongScoresFromNode( const XNode* pNode ) if( (*song)->name != "Song" ) continue; - CString sSongDir; - if( !(*song)->GetChildValue("SongDir", sSongDir) ) + const LPXAttr TypeAttr = (*song)->GetAttr( "Dir" ); + if( TypeAttr == NULL ) WARN_AND_CONTINUE; + const CString sSongDir = TypeAttr->value; Song* pSong = SONGMAN->GetSongFromDir( sSongDir ); if( pSong == NULL )