changeset 2922:438eb06a9c9f draft

Set label when selecting an address that already has a label. Fixes #1080.
author Wladimir J. van der Laan <laanwj@gmail.com>
date Fri, 13 Apr 2012 21:08:46 +0200
parents 5518e1ea4dd5
children 71a2f9308eb3
files src/qt/sendcoinsentry.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/qt/sendcoinsentry.cpp
+++ b/src/qt/sendcoinsentry.cpp
@@ -59,9 +59,11 @@
 {
     if(!model)
         return;
-    // Fill in label from address book, if no label is filled in yet
-    if(ui->addAsLabel->text().isEmpty())
-        ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));}
+    // Fill in label from address book, if address has an associated label
+    QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
+    if(!associatedLabel.isEmpty())
+        ui->addAsLabel->setText(associatedLabel);
+}
 
 void SendCoinsEntry::setModel(WalletModel *model)
 {