From d363722c1656733be0c75f73b7a65cd116c3d7da Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 13 Jun 2014 14:16:58 +0300 Subject: HTML: remove theme file if already exist in the export directory as QFile:copy doesn't overwrite files by default, we must check before copying if file exist and remove it. We must be able to overwrite files here, user is already notified and choosed to replace them. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- qt-ui/divelogexportdialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp index 3e07e70cd..b4bac0fa6 100644 --- a/qt-ui/divelogexportdialog.cpp +++ b/qt-ui/divelogexportdialog.cpp @@ -90,6 +90,12 @@ void DiveLogExportDialog::exportHtmlInit(const QString &filename) QFile::copy(searchPath + "dive_export.html", filename); QFile::copy(searchPath + "list_lib.js", exportFiles + "list_lib.js"); QFile::copy(searchPath + "poster.png", exportFiles + "poster.png"); + + // Remove theme file if already exist in the export dir + QFile theme(exportFiles + "theme.css"); + if (theme.exists()) + theme.remove(); + QFile::copy(searchPath + (ui->themeSelection->currentText() == "Light" ? "light.css" : "sand.css"), exportFiles + "theme.css"); } -- cgit v1.2.3-70-g09d2