summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-07-05 06:28:23 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-07-05 21:02:49 +0300
commita70cea95e8c67805945eda8e874a12f67daebe9f (patch)
tree3e7ae43723652862d14739ca4155e5c387685829
parent605e1e2d93996f57b3e48f698d840f517d84a99d (diff)
downloadsubsurface-a70cea95e8c67805945eda8e874a12f67daebe9f.tar.gz
Printing: refactor the print options class
-Remove unneeded parameter to member variable -Check if template_options struct is valid Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--qt-ui/printoptions.cpp8
-rw-r--r--qt-ui/printoptions.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/qt-ui/printoptions.cpp b/qt-ui/printoptions.cpp
index cd38e3560..08be76588 100644
--- a/qt-ui/printoptions.cpp
+++ b/qt-ui/printoptions.cpp
@@ -8,15 +8,15 @@ PrintOptions::PrintOptions(QWidget *parent, struct print_options *printOpt, stru
ui.setupUi(this);
if (parent)
setParent(parent);
- if (!printOpt)
+ if (!printOpt || !templateOpt)
return;
- setup(printOpt);
templateOptions = templateOpt;
+ printOptions = printOpt;
+ setup();
}
-void PrintOptions::setup(struct print_options *printOpt)
+void PrintOptions::setup()
{
- printOptions = printOpt;
// print type radio buttons
switch (printOptions->type) {
case print_options::DIVELIST:
diff --git a/qt-ui/printoptions.h b/qt-ui/printoptions.h
index 1d806b116..c33addc83 100644
--- a/qt-ui/printoptions.h
+++ b/qt-ui/printoptions.h
@@ -27,7 +27,7 @@ class PrintOptions : public QWidget {
public:
explicit PrintOptions(QWidget *parent, struct print_options *printOpt, struct template_options *templateOpt);
- void setup(struct print_options *printOpt);
+ void setup();
private:
Ui::PrintOptions ui;