mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-02 01:47:26 -04:00
QrCodeScanner: parse extra parameters
This commit is contained in:
@@ -61,15 +61,23 @@ void QrCodeScanner::processCode(int type, const QString &data)
|
||||
emit notifyError(error);
|
||||
return;
|
||||
}
|
||||
QVariantMap parsed_unknown_parameters;
|
||||
if(unknown_parameters.size() > 0)
|
||||
{
|
||||
qDebug() << "unknown parameters " << unknown_parameters;
|
||||
foreach(const QString &item, unknown_parameters )
|
||||
{
|
||||
QStringList parsed_item = item.split("=");
|
||||
if(parsed_item.size() == 2) {
|
||||
parsed_unknown_parameters.insert(parsed_item[0], parsed_item[1]);
|
||||
}
|
||||
}
|
||||
emit notifyError(error, true);
|
||||
}
|
||||
qDebug() << "Parsed URI : " << address << " " << payment_id << " " << amount << " " << tx_description << " " << recipient_name << " " << error;
|
||||
QString s_amount = WalletManager::instance()->displayAmount(amount);
|
||||
qDebug() << "Amount passed " << s_amount ;
|
||||
emit decoded(address, payment_id, s_amount, tx_description, recipient_name);
|
||||
emit decoded(address, payment_id, s_amount, tx_description, recipient_name, parsed_unknown_parameters);
|
||||
}
|
||||
void QrCodeScanner::processFrame(QVideoFrame frame)
|
||||
{
|
||||
@@ -102,3 +110,15 @@ void QrCodeScanner::timerEvent(QTimerEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
QrCodeScanner::~QrCodeScanner()
|
||||
{
|
||||
m_thread->stop();
|
||||
m_thread->quit();
|
||||
if(!m_thread->wait(5000))
|
||||
{
|
||||
m_thread->terminate();
|
||||
m_thread->wait();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user