summaryrefslogtreecommitdiffstats
path: root/templatelayout.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-20 06:14:19 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-20 06:14:19 -0700
commite3a8ff74934c8f5a11ee962650e889464da55522 (patch)
tree6bd206e1df040c4b504e00f5c71e295b8d17b6bd /templatelayout.cpp
parent7baa18db5fe33f5797e4603a4c2efafc6b474bd0 (diff)
parent599920c6cfd87a213634097045e29f592390438b (diff)
downloadsubsurface-e3a8ff74934c8f5a11ee962650e889464da55522.tar.gz
Merge branch 'custom-print' of github.com:neolit123/subsurface
Diffstat (limited to 'templatelayout.cpp')
-rw-r--r--templatelayout.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/templatelayout.cpp b/templatelayout.cpp
index 9a9dc9656..fec57cb2a 100644
--- a/templatelayout.cpp
+++ b/templatelayout.cpp
@@ -47,6 +47,7 @@ QString TemplateLayout::generate()
Grantlee::registerMetaType<Dive>();
Grantlee::registerMetaType<template_options>();
+ Grantlee::registerMetaType<print_options>();
QVariantHash mapping;
QVariantList diveList;
@@ -64,6 +65,7 @@ QString TemplateLayout::generate()
}
mapping.insert("dives", diveList);
mapping.insert("template_options", QVariant::fromValue(*templateOptions));
+ mapping.insert("print_options", QVariant::fromValue(*PrintOptions));
Grantlee::Context c(mapping);
@@ -104,6 +106,7 @@ void TemplateLayout::writeTemplate(QString template_name, QString grantlee_templ
QFile qfile(getSubsurfaceDataPath("printing_templates") + QDir::separator() + template_name);
if (qfile.open(QFile::ReadWrite | QFile::Text)) {
qfile.write(grantlee_template.toUtf8().data());
+ qfile.resize(qfile.pos());
qfile.close();
}
}