diff --git a/mainwindow.h b/mainwindow.h index 3a6fc6e3..a8136784 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -18,7 +18,7 @@ const int major_version=0; const int minor_version=8; -const int revision_number=4; +const int revision_number=5; namespace Ui { class MainWindow; diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index 678ebb1c..f0c36695 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -19,12 +19,20 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : ui->addressEdit->appendPlainText((*profile)["Address"].toString()); ui->emailEdit->setText((*profile)["EmailAddress"].toString()); ui->phoneEdit->setText((*profile)["Phone"].toString()); - bool gender=(*profile)["Gender"].toBool(); + bool gender; + if ((*profile).Exists("Gender")) { + gender=(*profile)["Gender"].toBool(); + } else gender=true; // the true gender.. How sexist.. ;) + if (gender) ui->genderMale->setChecked(true); else ui->genderFemale->setChecked(true); bool ok; ui->heightEdit->setValue((*profile)["Height"].toDouble(&ok)); - ui->dobEdit->setDate((*profile)["DOB"].toDate()); + if (!(*profile).Exists("DOB")) { + ui->dobEdit->setDate(QDate(1970,1,1)); + } else { + ui->dobEdit->setDate((*profile)["DOB"].toDate()); + } int i=ui->unitCombo->findText((*profile)["UnitSystem"].toString()); if (i<0) i=0; ui->unitCombo->setCurrentIndex(i);