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 Dec 20, 2024
1 parent 0f0d06b commit c08b93b
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 c08b93b

Please sign in to comment.