From 7f8d20c09d531a65dd8864e86b33766d49c0b04b Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Fri, 24 Jul 2015 16:23:50 +0200 Subject: 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 Signed-off-by: Lubomir I. Ivanov --- qt-ui/printdialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- cgit v1.2.3-70-g09d2