Fixed bug on empty database.
This commit is contained in:
@@ -43,6 +43,11 @@ AddressbookDataPtr AddressHelper::newAddress()
|
|||||||
|
|
||||||
AddressbookDataPtr AddressHelper::copyAddress()
|
AddressbookDataPtr AddressHelper::copyAddress()
|
||||||
{
|
{
|
||||||
|
if (m_copyAddress.isNull())
|
||||||
|
{
|
||||||
|
m_copyAddress = AddressbookDataPtr(new AddressbookData);
|
||||||
|
}
|
||||||
|
|
||||||
return m_copyAddress;
|
return m_copyAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,6 +99,9 @@ CampWizard::CampWizard(QWidget *parent) :
|
|||||||
Service<CountryData> coutrySrv;
|
Service<CountryData> coutrySrv;
|
||||||
m_addressBinder->registerBinding(ui->country, ComboData::createComboData(coutrySrv.all()));
|
m_addressBinder->registerBinding(ui->country, ComboData::createComboData(coutrySrv.all()));
|
||||||
|
|
||||||
|
m_addressBinder->setData(m_addrHelper->copyAddress().data());
|
||||||
|
m_addressBinder->bindToUi();
|
||||||
|
|
||||||
m_bindAddrCombo = true;
|
m_bindAddrCombo = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,3 +189,8 @@ void CampWizard::on_groupNew_clicked(bool checked)
|
|||||||
ui->address->setEnabled(true);
|
ui->address->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CampWizard::on_CampWizard_currentIdChanged(int id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ private slots:
|
|||||||
|
|
||||||
void on_groupNew_clicked(bool checked);
|
void on_groupNew_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_CampWizard_currentIdChanged(int id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::CampWizard *ui;
|
Ui::CampWizard *ui;
|
||||||
CampDataPtr m_data;
|
CampDataPtr m_data;
|
||||||
|
|||||||
Reference in New Issue
Block a user