summaryrefslogtreecommitdiffstats
path: root/templatelayout.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-24 09:53:07 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-28 11:37:30 +0300
commit2b2c506cb7e5e1659ad68818eca46d14d7840ecd (patch)
tree1085b0d8faa43c12818b89a4cfc7666a481457d0 /templatelayout.cpp
parentc95358c4b9c39016d08c234fb7e5db4958ff381e (diff)
downloadsubsurface-2b2c506cb7e5e1659ad68818eca46d14d7840ecd.tar.gz
Printing: use grantlee templates from the current existing template list
We use templates from the grantlee templates list created and dynamically. So we don't need static templates anymore. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'templatelayout.cpp')
-rw-r--r--templatelayout.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/templatelayout.cpp b/templatelayout.cpp
index 9caf773d0..8a03956f3 100644
--- a/templatelayout.cpp
+++ b/templatelayout.cpp
@@ -49,7 +49,6 @@ QString TemplateLayout::generate()
{
int progress = 0;
int totalWork = getTotalWork(PrintOptions);
- QString templateName;
QString htmlContent;
m_engine = new Grantlee::Engine(this);
@@ -83,14 +82,7 @@ QString TemplateLayout::generate()
Grantlee::Context c(mapping);
- if (PrintOptions->p_template == print_options::ONE_DIVE) {
- templateName = "one_dive.html";
- } else if (PrintOptions->p_template == print_options::TWO_DIVE) {
- templateName = "two_dives.html";
- } else if (PrintOptions->p_template == print_options::CUSTOM) {
- templateName = "custom.html";
- }
- Grantlee::Template t = m_engine->loadByName(templateName);
+ Grantlee::Template t = m_engine->loadByName(PrintOptions->p_template);
if (!t || t->error()) {
qDebug() << "Can't load template";
return htmlContent;