Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index c81d4d1..ec05a95 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -282,12 +282,14 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
282 | 282 | ||
283 | 283 | ||
284 | /** | 284 | /** |
285 | * Action that are toggled on hold (mostly QPopups i guess) | 285 | * Action that are toggled on hold (mostly QPopups i guess) |
286 | */ | 286 | */ |
287 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 287 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { |
288 | if (!item ) | ||
289 | return; | ||
288 | 290 | ||
289 | QPopupMenu *menu = new QPopupMenu(); | 291 | QPopupMenu *menu = new QPopupMenu(); |
290 | int ret=0; | 292 | int ret=0; |
291 | 293 | ||
292 | if ( ((BTListItem*)item)->type() == "device") { | 294 | if ( ((BTListItem*)item)->type() == "device") { |
293 | 295 | ||
@@ -339,15 +341,15 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
339 | BTServiceItem* service = (BTServiceItem*)item; | 341 | BTServiceItem* service = (BTServiceItem*)item; |
340 | QMap<int, QString> list = service->services().classIdList(); | 342 | QMap<int, QString> list = service->services().classIdList(); |
341 | QMap<int, QString>::Iterator it = list.begin(); | 343 | QMap<int, QString>::Iterator it = list.begin(); |
342 | QPopupMenu *popup =0l; | 344 | QPopupMenu *popup =0l; |
343 | if ( it != list.end() ) { | 345 | if ( it != list.end() ) { |
344 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 346 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
345 | popup = m_popHelper.find( it.key(), | 347 | popup = m_popHelper.find( it.key() /*1*/, |
346 | service->services(), | 348 | service->services(), |
347 | service->parent() ); | 349 | (BTDeviceItem*)service->parent() ); |
348 | }else { | 350 | }else { |
349 | qWarning("Empty"); | 351 | qWarning("Empty"); |
350 | } | 352 | } |
351 | 353 | ||
352 | if ( popup == 0l ) { | 354 | if ( popup == 0l ) { |
353 | qWarning("factory returned 0l"); | 355 | qWarning("factory returned 0l"); |
@@ -356,23 +358,24 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
356 | 358 | ||
357 | int test1 = popup->insertItem( tr("Test1:"), 0); | 359 | int test1 = popup->insertItem( tr("Test1:"), 0); |
358 | int con = popup->insertItem( tr("connect"), 1); | 360 | int con = popup->insertItem( tr("connect"), 1); |
359 | int del = popup->insertItem( tr("delete"), 2); | 361 | int del = popup->insertItem( tr("delete"), 2); |
360 | 362 | ||
361 | ret = popup->exec( point ); | 363 | ret = popup->exec( point ); |
362 | 364 | qWarning("returned from exec() "); | |
363 | if ( ret == -1 ) | 365 | if ( ret == -1 ) |
364 | delete popup; | 366 | ; |
365 | else if ( ret == test1 ) | 367 | else if ( ret == test1 ) |
366 | delete popup; | 368 | ; |
367 | else if ( ret == con ) | 369 | else if ( ret == con ) |
368 | delete popup; | 370 | ; |
369 | else if ( ret == del ) { | 371 | else if ( ret == del ) { |
370 | // take item first? -zecke | 372 | // take item first? -zecke |
371 | delete item; | 373 | delete item; |
372 | } | 374 | } |
375 | delete popup; | ||
373 | } | 376 | } |
374 | delete menu; | 377 | delete menu; |
375 | } | 378 | } |
376 | 379 | ||
377 | 380 | ||
378 | /** | 381 | /** |