summaryrefslogtreecommitdiffstats
path: root/helpers.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-10-19 00:25:14 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-18 17:37:49 -0700
commit894e7d5d39b8e926d06a10e7eb70300cb93bd374 (patch)
tree3808dae1c5a8dc16eb963e63ff5ec99eef032d39 /helpers.h
parentdbd07af59fd14d20e529c3561fb6cfc3a8fb1814 (diff)
downloadsubsurface-894e7d5d39b8e926d06a10e7eb70300cb93bd374.tar.gz
Print: copy the bundled templates to a safe location
This patch adds couple of helpers to retrieve the template path in the application bundle (getPrintingTemplatePathBundle()) and the template path in the user directory (getPrintingTemplatePathUser()). Once the print dialog is initiated for the first time the contents of the bundled template path are copied to the user template path using copyPath(). No overwriting of files will occur. The PrintOptions and TemplateLayout classes then only use the user path for retrieving templates. Fixes an issue where the bundled templates can be locked as read-only on OSX and Linux. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'helpers.h')
-rw-r--r--helpers.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/helpers.h b/helpers.h
index 6c5c31c7d..76c6ac9cd 100644
--- a/helpers.h
+++ b/helpers.h
@@ -27,6 +27,9 @@ void set_default_dive_computer(const char *vendor, const char *product);
void set_default_dive_computer_device(const char *name);
void set_default_dive_computer_download_mode(int downloadMode);
QString getSubsurfaceDataPath(QString folderToFind);
+QString getPrintingTemplatePathUser();
+QString getPrintingTemplatePathBundle();
+void copyPath(QString src, QString dst);
extern const QString get_dc_nickname(const char *model, uint32_t deviceid);
int gettimezoneoffset(timestamp_t when = 0);
int parseTemperatureToMkelvin(const QString &text);