diff options
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r-- | gui/mainwindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index afbd09f2..510bb21a 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -114,6 +114,15 @@ void MainWindow::saveTrace() tr("Trace Files (*.trace);;All Files (*)")); if (!fileName.isEmpty()) { + // copy won't overwrite existing files! + if (QFile::exists(fileName)) { + if (!QFile::remove(fileName)) { + QMessageBox::warning( + this, tr("Could not overwrite file"), + tr("The existing file %0 could not be replaced!") + .arg(fileName)); + } + } QFile::copy(localFile, fileName); } } |