aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-07-07 10:21:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-07 07:57:11 -0700
commitcfc87e9da3f5fb14c81032acd4c229cd97b97f87 (patch)
treeaa454e68653a8a8d5c85416ad0e6391098a70c33
parent7944978274c78c9e53e31e27ec3ba7f25aeb9b89 (diff)
downloadsubsurface-cfc87e9da3f5fb14c81032acd4c229cd97b97f87.tar.gz
cleanup: remove Printer::dpi member variable
This variable is not used outside a single function, where it is reset every time the function runs. This can be realized by a function-local variable just as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--desktop-widgets/printer.cpp5
-rw-r--r--desktop-widgets/printer.h1
2 files changed, 2 insertions, 4 deletions
diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp
index 3c4a21010..77c6459fb 100644
--- a/desktop-widgets/printer.cpp
+++ b/desktop-widgets/printer.cpp
@@ -21,8 +21,7 @@ Printer::Printer(QPaintDevice *paintDevice, const print_options &printOptions, c
templateOptions(templateOptions),
printMode(printMode),
inPlanner(inPlanner),
- done(0),
- dpi(0)
+ done(0)
{
}
@@ -227,7 +226,7 @@ void Printer::print()
TemplateLayout t(printOptions, templateOptions);
connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int)));
- dpi = printerPtr->resolution();
+ int dpi = printerPtr->resolution();
//rendering resolution = selected paper size in inchs * printer dpi
pageSize.setHeight(qCeil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
pageSize.setWidth(qCeil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
diff --git a/desktop-widgets/printer.h b/desktop-widgets/printer.h
index 43a1fa9b7..c841da2c9 100644
--- a/desktop-widgets/printer.h
+++ b/desktop-widgets/printer.h
@@ -29,7 +29,6 @@ private:
PrintMode printMode;
bool inPlanner;
int done;
- int dpi;
void render(int Pages);
void flowRender();
void putProfileImage(const QRect &box, const QRect &viewPort, QPainter *painter,