From 9ea32a015870638c2a848d4ceab13a204b05c2ae Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 22 Mar 2019 21:33:17 +0100 Subject: avoid duplicate and inconsistent applying of QDir::separator() Signed-off-by: Rolf Eike Beer --- core/divelogexportlogic.cpp | 20 +++++++++----------- core/divelogexportlogic.h | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'core') diff --git a/core/divelogexportlogic.cpp b/core/divelogexportlogic.cpp index 1a0779422..dff7eefc9 100644 --- a/core/divelogexportlogic.cpp +++ b/core/divelogexportlogic.cpp @@ -10,7 +10,7 @@ #include "statistics.h" #include "save-html.h" -void file_copy_and_overwrite(const QString &fileName, const QString &newName) +static void file_copy_and_overwrite(const QString &fileName, const QString &newName) { QFile file(newName); if (file.exists()) @@ -18,7 +18,7 @@ void file_copy_and_overwrite(const QString &fileName, const QString &newName) QFile::copy(fileName, newName); } -void exportHTMLsettings(const QString &filename, struct htmlExportSetting &hes) +static void exportHTMLsettings(const QString &filename, struct htmlExportSetting &hes) { QString fontSize = hes.fontSize; QString fontFamily = hes.fontFamily; @@ -128,21 +128,19 @@ void exportHtmlInitLogic(const QString &filename, struct htmlExportSetting &hes) QFile file(filename); QFileInfo info(file); QDir mainDir = info.absoluteDir(); - mainDir.mkdir(file.fileName() + "_files"); - QString exportFiles = file.fileName() + "_files"; + QString exportFiles = file.fileName() + "_files" + QDir::separator(); + mainDir.mkdir(exportFiles); - QString json_dive_data = exportFiles + QDir::separator() + "file.js"; - QString json_settings = exportFiles + QDir::separator() + "settings.js"; - QString translation = exportFiles + QDir::separator() + "translation.js"; - QString stat_file = exportFiles + QDir::separator() + "stat.js"; - exportFiles += "/"; + QString json_dive_data = exportFiles + "file.js"; + QString json_settings = exportFiles + "settings.js"; + QString translation = exportFiles + "translation.js"; + QString stat_file = exportFiles + "stat.js"; if (hes.exportPhotos) { - photosDirectory = exportFiles + QDir::separator() + "photos" + QDir::separator(); + photosDirectory = exportFiles + "photos" + QDir::separator(); mainDir.mkdir(photosDirectory); } - exportHTMLsettings(json_settings, hes); exportHTMLstatistics(stat_file, hes); export_translation(qPrintable(translation)); diff --git a/core/divelogexportlogic.h b/core/divelogexportlogic.h index 4279495a0..693ccb759 100644 --- a/core/divelogexportlogic.h +++ b/core/divelogexportlogic.h @@ -14,7 +14,6 @@ struct htmlExportSetting { QString themeFile; }; -void file_copy_and_overwrite(const QString &fileName, const QString &newName); void exportHtmlInitLogic(const QString &filename, struct htmlExportSetting &hes); #endif // DIVELOGEXPORTLOGIC_H -- cgit v1.2.3-70-g09d2