Fix issue when multiple devices with the same name are present. This resolves issue #24.

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
pull/23/head
Emanoil Kotsev 2 years ago committed by TDE Gitea
parent e0a77280fd
commit bf0db26c6c

@ -626,6 +626,17 @@ void DeviceWizard::slotInsertDevice(const TQString& path)
TQListViewItem *devItem = deviceBox->findItem(addr, 2, TQt::ExactMatch);
int nitems=0;
TQListViewItem * devItem2 = deviceBox->firstChild();
while( devItem2 ) {
TQString iname = devItem2->text(1);
if ( iname.startsWith(name) )
nitems++;
devItem2 = devItem2->nextSibling();
}
// device with same name already exists
if (nitems>0)
name = name.append("#%1").arg(nitems);
//device was already setup but is not in the deviceBox
if (paired && !devItem)
{

Loading…
Cancel
Save