|
|
@ -53,10 +53,19 @@ bool GUIUtil::parseBitcoinURL(const QUrl *url, SendCoinsRecipient *out) |
|
|
|
SendCoinsRecipient rv; |
|
|
|
SendCoinsRecipient rv; |
|
|
|
rv.address = url->path(); |
|
|
|
rv.address = url->path(); |
|
|
|
rv.label = url->queryItemValue("label"); |
|
|
|
rv.label = url->queryItemValue("label"); |
|
|
|
if(!BitcoinUnits::parse(BitcoinUnits::BTC, url->queryItemValue("amount"), &rv.amount)) |
|
|
|
|
|
|
|
|
|
|
|
QString amount = url->queryItemValue("amount"); |
|
|
|
|
|
|
|
if(amount.isEmpty()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
rv.amount = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else // Amount is non-empty
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(!BitcoinUnits::parse(BitcoinUnits::BTC, amount, &rv.amount)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if(out) |
|
|
|
if(out) |
|
|
|
{ |
|
|
|
{ |
|
|
|
*out = rv; |
|
|
|
*out = rv; |
|
|
|