From f22d32f70aba5fc2913a7ea76a8d5e5d08bc3fb7 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 16 May 2006 06:01:12 +0000 Subject: [PATCH] fix catalog.xml out of date after reloading songs --- stepmania/src/CatalogXml.cpp | 2 +- stepmania/src/CatalogXml.h | 5 ++++- stepmania/src/SongManager.cpp | 2 ++ stepmania/src/StepMania.cpp | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/stepmania/src/CatalogXml.cpp b/stepmania/src/CatalogXml.cpp index e2d34f56e5..8e32cd65ad 100644 --- a/stepmania/src/CatalogXml.cpp +++ b/stepmania/src/CatalogXml.cpp @@ -37,7 +37,7 @@ const RString CATALOG_XSL = "Catalog.xsl"; const RString CATALOG_XML_FILE = "Save/" + CATALOG_XML; static LocalizedString SAVING_CATALOG_XML( "CatalogXml", "Saving %s ..." ); -void SaveCatalogXml( LoadingWindow *loading_window ) +void CatalogXml::Save( LoadingWindow *loading_window ) { ASSERT( SONGMAN ); ASSERT( UNLOCKMAN ); diff --git a/stepmania/src/CatalogXml.h b/stepmania/src/CatalogXml.h index 7af5586fec..fe28f1c83c 100644 --- a/stepmania/src/CatalogXml.h +++ b/stepmania/src/CatalogXml.h @@ -9,7 +9,10 @@ extern const RString CATALOG_XML; extern const RString CATALOG_XSL; extern const RString CATALOG_XML_FILE; -void SaveCatalogXml( LoadingWindow *ld ); +namespace CatalogXml +{ + void Save( LoadingWindow *ld ); +}; #endif diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 88f53f56e7..19072e203e 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -34,6 +34,7 @@ #include "CourseLoaderCRS.h" #include "TitleSubstitution.h" #include "LocalizedString.h" +#include "CatalogXml.h" SongManager* SONGMAN = NULL; // global and accessable from anywhere in our program @@ -99,6 +100,7 @@ void SongManager::Reload( bool bAllowFastLoad, LoadingWindow *ld ) // reload scores and unlocks afterward PROFILEMAN->LoadMachineProfile(); UNLOCKMAN->Reload(); + CatalogXml::Save( NULL ); if( !bAllowFastLoad ) PREFSMAN->m_bFastLoad.Set( OldVal ); diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index e3be151fd5..e3e51ee5e4 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1063,7 +1063,7 @@ int main(int argc, char* argv[]) /* This shouldn't need to be here; if it's taking long enough that this is * even visible, we should be fixing it, not showing a progress display. */ - SaveCatalogXml( loading_window ); + CatalogXml::Save( loading_window ); NSMAN = new NetworkSyncManager( loading_window ); MESSAGEMAN = new MessageManager;