Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 433bd3a..1fd0ea2 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -288,28 +288,29 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
288 | */ | 288 | */ |
289 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 289 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { |
290 | if (!item ) | 290 | if (!item ) |
291 | return; | 291 | return; |
292 | 292 | ||
293 | QPopupMenu *menu = new QPopupMenu(); | 293 | QPopupMenu *menu = new QPopupMenu(); |
294 | int ret=0; | 294 | int ret=0; |
295 | 295 | ||
296 | if ( ((BTListItem*)item)->type() == "device") { | 296 | if ( ((BTListItem*)item)->type() == "device") { |
297 | 297 | ||
298 | QPopupMenu *groups = new QPopupMenu(); | 298 | QPopupMenu *groups = new QPopupMenu(); |
299 | 299 | ||
300 | menu->insertItem( tr("rescan sevices:"), 0); | 300 | menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); |
301 | menu->insertItem( tr("to group"), groups , 1); | 301 | menu->insertSeparator(1); |
302 | // menu->insertItem( tr("bound device"), 2); | 302 | menu->insertItem( tr("rescan sevices"), 2); |
303 | menu->insertItem( tr("delete"), 3); | 303 | menu->insertItem( tr("to group"), groups , 3); |
304 | menu->insertItem( tr("delete"), 4); | ||
304 | 305 | ||
305 | ret = menu->exec( point , 0); | 306 | ret = menu->exec( point , 0); |
306 | 307 | ||
307 | switch(ret) { | 308 | switch(ret) { |
308 | case -1: | 309 | case -1: |
309 | break; | 310 | break; |
310 | case 0: | 311 | case 0: |
311 | addServicesToDevice( (BTDeviceItem*)item ); | 312 | addServicesToDevice( (BTDeviceItem*)item ); |
312 | break; | 313 | break; |
313 | case 1: | 314 | case 1: |
314 | 315 | ||
315 | break; | 316 | break; |
@@ -335,24 +336,26 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
335 | * one if the factory returns 0 | 336 | * one if the factory returns 0 |
336 | * PopupMenu deletion is kind of weird. | 337 | * PopupMenu deletion is kind of weird. |
337 | * If escaped( -1 ) or any of our items were chosen we'll | 338 | * If escaped( -1 ) or any of our items were chosen we'll |
338 | * delete the PopupMenu otherwise it's the responsibility of | 339 | * delete the PopupMenu otherwise it's the responsibility of |
339 | * the PopupMenu to delete itself | 340 | * the PopupMenu to delete itself |
340 | * | 341 | * |
341 | */ | 342 | */ |
342 | else if ( ((BTListItem*)item)->type() == "service") { | 343 | else if ( ((BTListItem*)item)->type() == "service") { |
343 | BTServiceItem* service = (BTServiceItem*)item; | 344 | BTServiceItem* service = (BTServiceItem*)item; |
344 | QMap<int, QString> list = service->services().classIdList(); | 345 | QMap<int, QString> list = service->services().classIdList(); |
345 | QMap<int, QString>::Iterator it = list.begin(); | 346 | QMap<int, QString>::Iterator it = list.begin(); |
346 | QPopupMenu *popup =0l; | 347 | QPopupMenu *popup =0l; |
348 | popup->insertItem( (service->services()).serviceName() ); | ||
349 | popup->insertSeparator(); | ||
347 | if ( it != list.end() ) { | 350 | if ( it != list.end() ) { |
348 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 351 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
349 | popup = m_popHelper.find( it.key() /*1*/, | 352 | popup = m_popHelper.find( it.key() /*1*/, |
350 | service->services(), | 353 | service->services(), |
351 | (BTDeviceItem*)service->parent() ); | 354 | (BTDeviceItem*)service->parent() ); |
352 | }else { | 355 | }else { |
353 | qWarning("Empty"); | 356 | qWarning("Empty"); |
354 | } | 357 | } |
355 | 358 | ||
356 | if ( popup == 0l ) { | 359 | if ( popup == 0l ) { |
357 | qWarning("factory returned 0l"); | 360 | qWarning("factory returned 0l"); |
358 | popup = new QPopupMenu(); | 361 | popup = new QPopupMenu(); |