Skip to content

Commit

Permalink
Begin transaction only when exclusive connection fails (#365)
Browse files Browse the repository at this point in the history
IB-5540

Signed-off-by: Raul Metsma <raul@metsma.ee>
  • Loading branch information
metsma authored and iannaska committed Oct 22, 2018
1 parent 9f5ef6b commit fb7fdbf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/dialogs/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,11 @@ void Updater::process(const QByteArray &data)
if(obj.value(QStringLiteral("protocol")).toString() == QStringLiteral("T=0")) mode = QPCSCReader::T0;
if(obj.value(QStringLiteral("protocol")).toString() == QStringLiteral("T=1")) mode = QPCSCReader::T1;
quint32 err = 0;
if((err = d->reader->connectEx(QPCSCReader::Exclusive, mode)) == 0 ||
(err = d->reader->connectEx(QPCSCReader::Shared, mode)) == 0)
d->reader->beginTransaction();
if((err = d->reader->connectEx(QPCSCReader::Exclusive, mode)) != 0)
{
if((err = d->reader->connectEx(QPCSCReader::Shared, mode)) == 0)
d->reader->beginTransaction();
}
QVariantHash ret{
{"CONNECT", d->reader->isConnected() ? "OK" : "NOK"},
{"reader", d->reader->name()},
Expand Down

0 comments on commit fb7fdbf

Please sign in to comment.