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>
This commit is contained in:
Gehad elrobey 2015-07-24 16:23:50 +02:00 committed by Lubomir I. Ivanov
parent 2a85be91b1
commit 7f8d20c09d

View file

@ -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;