Commit 0e1237d6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add code to add new address

parent 811b2024
......@@ -34,12 +34,12 @@ public:
explicit AddressesLocationViewer(QWidget *parent = Q_NULLPTR);
~AddressesLocationViewer();
void addAddress(const KContacts::Address &address);
KContacts::Address::List addresses() const;
void setAddresses(const KContacts::Address::List &addresses);
public Q_SLOTS:
void addAddress(const KContacts::Address &address);
private Q_SLOTS:
void slotLinkClicked(const QUrl &url);
......
......@@ -40,6 +40,7 @@ AddressesLocationWidget::AddressesLocationWidget(QWidget *parent)
mAddressesLocationViewer->setObjectName(QStringLiteral("addresseslocationviewer"));
topLayout->addWidget(mAddressesLocationViewer);
connect(mAddressesLocationViewer, &AddressesLocationViewer::modifyAddress, addressLocationWidget, &AddressLocationWidget::slotModifyAddress);
connect(addressLocationWidget, &AddressLocationWidget::addNewAddress, mAddressesLocationViewer, &AddressesLocationViewer::addAddress);
setLayout(topLayout);
}
......
......@@ -122,7 +122,10 @@ AddressLocationWidget::~AddressLocationWidget()
void AddressLocationWidget::slotAddAddress()
{
//TODO
KContacts::Address addr = address();
if (!addr.isEmpty()) {
Q_EMIT addNewAddress(addr);
}
}
void AddressLocationWidget::setAddress(const KContacts::Address &address)
......
......@@ -44,6 +44,8 @@ public:
void slotModifyAddress(const KContacts::Address &address, int currentIndex);
void clear();
Q_SIGNALS:
void addNewAddress(const KContacts::Address &address);
private Q_SLOTS:
void slotAddAddress();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment