diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-08-28 09:15:56 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-28 09:15:56 -0700 |
commit | d5aacd092dd7bb7dbe937c300071f6369a967a4c (patch) | |
tree | 223b3c33a212d0e82c9056631569813a80cf301d /templatelayout.cpp | |
parent | 4360cee196966d0fbfe4470c25364790a5579806 (diff) | |
download | subsurface-d5aacd092dd7bb7dbe937c300071f6369a967a4c.tar.gz |
Fix printing on Mac
While I cannot explain for the life of me why this worked on Linux and
Windows and not on Mac, what I have now seems to work on all three
platforms.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'templatelayout.cpp')
-rw-r--r-- | templatelayout.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/templatelayout.cpp b/templatelayout.cpp index c52968f09..57cc4c5e8 100644 --- a/templatelayout.cpp +++ b/templatelayout.cpp @@ -73,7 +73,6 @@ QString TemplateLayout::generate() Grantlee::registerMetaType<template_options>(); Grantlee::registerMetaType<print_options>(); - QVariantHash mapping; QVariantList diveList; struct dive *dive; @@ -87,11 +86,10 @@ QString TemplateLayout::generate() progress++; emit progressUpdated(progress * 100.0 / totalWork); } - mapping.insert("dives", diveList); - mapping.insert("template_options", QVariant::fromValue(*templateOptions)); - mapping.insert("print_options", QVariant::fromValue(*PrintOptions)); - - Grantlee::Context c(mapping); + Grantlee::Context c; + c.insert("dives", diveList); + c.insert("template_options", QVariant::fromValue(*templateOptions)); + c.insert("print_options", QVariant::fromValue(*PrintOptions)); Grantlee::Template t = m_engine->loadByName(PrintOptions->p_template); if (!t || t->error()) { @@ -122,7 +120,6 @@ QString TemplateLayout::generateStatistics() Grantlee::registerMetaType<template_options>(); Grantlee::registerMetaType<print_options>(); - QVariantHash mapping; QVariantList years; int i = 0; @@ -132,11 +129,10 @@ QString TemplateLayout::generateStatistics() i++; } - mapping.insert("years", years); - mapping.insert("template_options", QVariant::fromValue(*templateOptions)); - mapping.insert("print_options", QVariant::fromValue(*PrintOptions)); - - Grantlee::Context c(mapping); + Grantlee::Context c; + c.insert("years", years); + c.insert("template_options", QVariant::fromValue(*templateOptions)); + c.insert("print_options", QVariant::fromValue(*PrintOptions)); Grantlee::Template t = m_engine->loadByName(PrintOptions->p_template); if (!t || t->error()) { |