aboutsummaryrefslogtreecommitdiffstats
path: root/printer.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-06-14 06:25:35 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-06-19 21:41:57 +0300
commit60c5e3cf25e0966fa7ec5f90d5e04404e7fae81f (patch)
tree88f6098cf5c402094d973a8cb16eb36ea232f4c6 /printer.cpp
parent42b9d0d047abfa9b7816f59d00a0ed0f87368975 (diff)
downloadsubsurface-60c5e3cf25e0966fa7ec5f90d5e04404e7fae81f.tar.gz
Printing: pass the print_options struct to TemplateLayout and Printer
As the print_options struct is needed by both TemplateLayout and Printer class, it can be passed to their constructor. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'printer.cpp')
-rw-r--r--printer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/printer.cpp b/printer.cpp
index 6d4e4898b..5116521fa 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -9,9 +9,10 @@
#define A4_300DPI_WIDTH 2480
#define A4_300DPI_HIGHT 3508
-Printer::Printer(QPrinter *printer)
+Printer::Printer(QPrinter *printer, print_options *printOptions)
{
this->printer = printer;
+ this->printOptions = printOptions;
//override these settings for now.
printer->setFullPage(true);
@@ -112,7 +113,7 @@ void Printer::templateProgessUpdated(int value)
void Printer::print()
{
- TemplateLayout t;
+ TemplateLayout t(printOptions);
connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int)));
webView = new QWebView();
webView->setHtml(t.generate());