From 183564d1ea2a4cfaf3e8a619cae0d79ade282fb5 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 2 Sep 2011 18:19:23 +0100 Subject: [PATCH] SplitRide overwrites existing file Fixes #165. --- src/SplitRideDialog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SplitRideDialog.cpp b/src/SplitRideDialog.cpp index 441f4119a..5398927bf 100644 --- a/src/SplitRideDialog.cpp +++ b/src/SplitRideDialog.cpp @@ -163,7 +163,11 @@ SplitRideDialog::CreateNewRideFile(const RideFile *ride, int nRecStart, int nRec QFile file(filePath); if (file.exists()) { - QMessageBox::critical(this, tr("Split Ride"), tr("The file %1 already exists and will not be overwritten").arg(filePath)); + QString backupPath = filePath + ".bak"; + QMessageBox::warning(this, tr("Split Ride"), tr("The file %1 already exists and will backed up to %2").arg(filePath).arg(backupPath)); + + QFile(backupPath).remove(); // just wipe away any previously saved backup + file.rename(backupPath); return; }