Update of /cvsroot/wpdev/wolfpack/muls
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16958
Modified Files:
maps.cpp
Log Message:
look for mapdi* stadif* and friends so it's not necessary to rename those files under *nix to be lower()
Index: maps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** maps.cpp 17 Sep 2004 16:34:01 -0000 1.12
--- maps.cpp 20 Sep 2004 03:35:37 -0000 1.13
***************
*** 122,134 ****
}
! void MapsPrivate::loadDiffs( const QString& basepath, unsigned int id )
{
// Try to read the index
! QFile mapdiflist( basepath + QString( "mapdifl%1.mul" ).arg( id ) );
! mapdifdata.setName( basepath + QString( "mapdif%1.mul" ).arg( id ) );
! mapdifdata.open( IO_ReadOnly );
// Try to read a list of ids
! if ( mapdifdata.isOpen() && mapdiflist.open( IO_ReadOnly ) )
{
QDataStream listinput( &mapdiflist );
--- 122,154 ----
}
! void MapsPrivate::loadDiffs( const QString& basePath, unsigned int id )
{
// Try to read the index
! QDir baseFolder( basePath );
! QStringList files = baseFolder.entryList();
! QString mapDiffListName = QString( "mapdifl%1.mul" ).arg( id );
! QString mapDiffFileName = QString( "mapdif%1.mul" ).arg( id );
! QString statDiffFileName = QString( "stadif%1.mul" ).arg( id );
! QString statDiffListName = QString( "stadifl%1.mul" ).arg( id );
! QString statDiffIndexName = QString( "stadifi%1.mul" ).arg( id );
! for ( QStringList::const_iterator it = files.begin(); it != files.end(); ++it )
! {
! if ( ( *it ).lower() == mapDiffListName )
! mapDiffListName = *it;
! else if ( ( *it ).lower() == mapDiffFileName )
! mapDiffFileName = *it;
! else if ( ( *it ).lower() == statDiffFileName )
! statDiffFileName = *it;
! else if ( ( *it ).lower() == statDiffListName )
! statDiffListName = *it;
! else if ( ( *it ).lower() == statDiffIndexName )
! statDiffIndexName = *it;
! }
+ QFile mapdiflist( basePath + mapDiffListName );
+ mapdifdata.setName( basePath + mapDiffFileName );
+
// Try to read a list of ids
! if ( mapdifdata.open( IO_ReadOnly ) && mapdiflist.open( IO_ReadOnly ) )
{
QDataStream listinput( &mapdiflist );
***************
*** 145,153 ****
}
! stadifdata.setName( basepath + QString( "stadif%1.mul" ).arg( id ) );
stadifdata.open( IO_ReadOnly );
! QFile stadiflist( basepath + QString( "stadifl%1.mul" ).arg( id ) );
! QFile stadifindex( basepath + QString( "stadifi%1.mul" ).arg( id ) );
if ( stadifindex.open( IO_ReadOnly ) && stadiflist.open( IO_ReadOnly ) )
--- 165,173 ----
}
! stadifdata.setName( basePath + statDiffFileName );
stadifdata.open( IO_ReadOnly );
! QFile stadiflist( basePath + statDiffListName );
! QFile stadifindex( basePath + statDiffIndexName );
if ( stadifindex.open( IO_ReadOnly ) && stadiflist.open( IO_ReadOnly ) )
|