Skip to content

Commit

Permalink
core: check if the uri already exists when adding a new device in bro…
Browse files Browse the repository at this point in the history
…wser.

If the device was save as selected for auto-connection from a previous
session but the same device is also detected during scanning, the
browser will have duplicate entries of the same device, allowing us
to connect to both. This should not be possible in most cases: the best
example is the ADALM2000 USB connection.

Signed-off-by: AlexandraTrifan <[email protected]>
  • Loading branch information
AlexandraTrifan committed Jan 17, 2025
1 parent e76d7ab commit 8f9ed1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/devicemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ void DeviceManager::addDevice(Device *d)

QString DeviceManager::createDevice(QString category, QString param, bool async, QList<QString> plugins)
{
for(Device *val : qAsConst(map)) {
if(val->param() == param) {
return "";
}
}
qInfo(CAT_DEVICEMANAGER) << category << "device with params" << param << "added";
Q_EMIT deviceAddStarted(param);

Expand Down

0 comments on commit 8f9ed1a

Please sign in to comment.