From d53fed72d8c2099aeb1ac8d104211a4ea24bdd9c Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 21 May 2017 16:43:12 +0200 Subject: [PATCH] Fixed bug on empty database. --- camp/campwizard.cpp | 13 +++++++++++++ camp/campwizard.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/camp/campwizard.cpp b/camp/campwizard.cpp index 2f7b23f..22e0f42 100644 --- a/camp/campwizard.cpp +++ b/camp/campwizard.cpp @@ -43,6 +43,11 @@ AddressbookDataPtr AddressHelper::newAddress() AddressbookDataPtr AddressHelper::copyAddress() { + if (m_copyAddress.isNull()) + { + m_copyAddress = AddressbookDataPtr(new AddressbookData); + } + return m_copyAddress; } @@ -94,6 +99,9 @@ CampWizard::CampWizard(QWidget *parent) : Service coutrySrv; m_addressBinder->registerBinding(ui->country, ComboData::createComboData(coutrySrv.all())); + m_addressBinder->setData(m_addrHelper->copyAddress().data()); + m_addressBinder->bindToUi(); + m_bindAddrCombo = true; } @@ -181,3 +189,8 @@ void CampWizard::on_groupNew_clicked(bool checked) ui->address->setEnabled(true); } } + +void CampWizard::on_CampWizard_currentIdChanged(int id) +{ + +} diff --git a/camp/campwizard.h b/camp/campwizard.h index 35f84c4..925de2c 100644 --- a/camp/campwizard.h +++ b/camp/campwizard.h @@ -54,6 +54,8 @@ private slots: void on_groupNew_clicked(bool checked); + void on_CampWizard_currentIdChanged(int id); + private: Ui::CampWizard *ui; CampDataPtr m_data;