mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
605e1e2d93
commit
a70cea95e8
2 changed files with 5 additions and 5 deletions
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue