diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-07-24 16:23:50 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2015-07-28 11:37:35 +0300 |
commit | 7f8d20c09d531a65dd8864e86b33766d49c0b04b (patch) | |
tree | 90196cf4be814a67bd9b3efc9b3d16e91663d656 /qt-ui | |
parent | 2a85be91b1bc3ae80a75e5508ffdfc7b7e4c1daa (diff) | |
download | subsurface-7f8d20c09d531a65dd8864e86b33766d49c0b04b.tar.gz |
Printing: fix issue with old QSettings group
As I am using the same old QSettings group name, some variables may not
be correctly initialized, so we need to check for incorrect values
before we start.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/printdialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index c7ce327f5..c42ec6fb9 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -56,6 +56,14 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f custom_colors.color5 = QColor(s.value("custom_color_5").toString()); } + // handle cases from old QSettings group + if (templateOptions.font_size < 9) { + templateOptions.font_size = 9; + } + if (templateOptions.line_spacing < 1) { + templateOptions.line_spacing = 1; + } + switch (templateOptions.color_palette_index) { case 0: // almond templateOptions.color_palette = almond_colors; |