Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9013
Modified Files:
world.cpp
Log Message:
filename now prepends dirname on deletion, too ;)
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.131
retrieving revision 1.132
diff -C2 -d -r1.131 -r1.132
*** world.cpp 1 Oct 2004 16:32:53 -0000 1.131
--- world.cpp 2 Oct 2004 00:28:47 -0000 1.132
***************
*** 1341,1344 ****
--- 1341,1346 ----
QMap<QDateTime, QString> backups = listBackups(filename);
+ QString backupName = QFileInfo(filename).dirPath(true) + QDir::separator();
+
if (backups.count() >= count) {
// Remove the oldest backup
***************
*** 1354,1358 ****
}
! if (!backup.isNull() && !QFile::remove(backup)) {
Console::instance()->log(LOG_ERROR, QString("Unable to remove backup %1. No new backup has been created.\n").arg(backup));
return;
--- 1356,1360 ----
}
! if (!backup.isNull() && !QFile::remove( backupName + backup )) {
Console::instance()->log(LOG_ERROR, QString("Unable to remove backup %1. No new backup has been created.\n").arg(backup));
return;
***************
*** 1361,1365 ****
// Rename the old worldfile to the new backup name
! QString backupName = QFileInfo(filename).dirPath(true) + QDir::separator() + QFileInfo(filename).baseName(false);
QDateTime current = QDateTime::currentDateTime();
backupName.append(current.toString("-yyyyMMdd-hhmm")); // Append Timestamp
--- 1363,1367 ----
// Rename the old worldfile to the new backup name
! backupName.append( QFileInfo(filename).baseName(false) );
QDateTime current = QDateTime::currentDateTime();
backupName.append(current.toString("-yyyyMMdd-hhmm")); // Append Timestamp
|