diff --git a/stepmania/src/RageFileDriverDirect.cpp b/stepmania/src/RageFileDriverDirect.cpp index 6db9f4fbd8..d5d9a1bc8c 100644 --- a/stepmania/src/RageFileDriverDirect.cpp +++ b/stepmania/src/RageFileDriverDirect.cpp @@ -176,6 +176,7 @@ bool RageFileDriverDirect::Remount( const CString &sPath ) root = sPath; if( root.Right(1) != "/" ) root += '/'; + ((DirectFilenameDB *) FDB)->SetRoot( sPath ); /* If the root path doesn't exist, create it. */ CreateDirectories( root ); diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index 38587b92a5..4bf2d67eb1 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -226,6 +226,12 @@ bool CreateDirectories( CString Path ) DirectFilenameDB::DirectFilenameDB( CString root_ ) { ExpireSeconds = 30; + SetRoot( root_ ); +} + + +void DirectFilenameDB::SetRoot( CString root_ ) +{ root = root_; if( root.Right(1) != "/" ) root += '/'; diff --git a/stepmania/src/RageFileDriverDirectHelpers.h b/stepmania/src/RageFileDriverDirectHelpers.h index 4081dfadc7..e54cbc48b2 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.h +++ b/stepmania/src/RageFileDriverDirectHelpers.h @@ -35,12 +35,13 @@ bool PathReady( CString path ); #include "RageUtil_FileDB.h" class DirectFilenameDB: public FilenameDB { +public: + DirectFilenameDB( CString root ); + void SetRoot( CString root ); + protected: virtual void PopulateFileSet( FileSet &fs, const CString &sPath ); CString root; - -public: - DirectFilenameDB( CString root_ ); }; #endif diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index 3fe37fc112..b38b1d3300 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -503,13 +503,15 @@ void RageFileManager::Remount( CString sMountpoint, CString sPath ) RageFileDriver *pDriver = FILEMAN->GetFileDriver( sMountpoint ); if( pDriver == NULL ) { - LOG->Warn( "Remount(%s,%s): mountpoint not found", - sMountpoint.c_str(), sPath.c_str() ); + if( LOG ) + LOG->Warn( "Remount(%s,%s): mountpoint not found", sMountpoint.c_str(), sPath.c_str() ); return; } if( !pDriver->Remount(sPath) ) LOG->Warn( "Remount(%s,%s): remount failed (does the driver support remounting?)" ); + else + pDriver->FlushDirCache( "" ); FILEMAN->ReleaseFileDriver( pDriver ); }