diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tdebluez/devicewizard.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tdebluez/devicewizard.cpp b/src/tdebluez/devicewizard.cpp index f7f44db..ee4c04b 100644 --- a/src/tdebluez/devicewizard.cpp +++ b/src/tdebluez/devicewizard.cpp @@ -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) { |