summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Rolf Eike Beer <eike@sf-mail.de>2019-03-22 21:33:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-03-27 07:36:33 -0700
commit9ea32a015870638c2a848d4ceab13a204b05c2ae (patch)
tree9e0295e4839147aa0fc8db5115e3c9badfaef91e /core
parentbf9a526d63854f1ebb5bf102d54cc170f29ce370 (diff)
downloadsubsurface-9ea32a015870638c2a848d4ceab13a204b05c2ae.tar.gz
avoid duplicate and inconsistent applying of QDir::separator()
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'core')
-rw-r--r--core/divelogexportlogic.cpp20
-rw-r--r--core/divelogexportlogic.h1
2 files changed, 9 insertions, 12 deletions
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