summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp15
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
@@ -276,24 +276,26 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
276 276
277/** 277/**
278 * Action that is toggled on entrys on click 278 * Action that is toggled on entrys on click
279 */ 279 */
280void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { 280void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) {
281} 281}
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 */
287void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { 287void 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
294 QPopupMenu *groups = new QPopupMenu(); 296 QPopupMenu *groups = new QPopupMenu();
295 297
296 menu->insertItem( tr("rescan sevices:"), 0); 298 menu->insertItem( tr("rescan sevices:"), 0);
297 menu->insertItem( tr("to group"), groups , 1); 299 menu->insertItem( tr("to group"), groups , 1);
298 // menu->insertItem( tr("bound device"), 2); 300 // menu->insertItem( tr("bound device"), 2);
299 menu->insertItem( tr("delete"), 3); 301 menu->insertItem( tr("delete"), 3);
@@ -333,52 +335,53 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
333 * If escaped( -1 ) or any of our items were chosen we'll 335 * If escaped( -1 ) or any of our items were chosen we'll
334 * delete the PopupMenu otherwise it's the responsibility of 336 * delete the PopupMenu otherwise it's the responsibility of
335 * the PopupMenu to delete itself 337 * the PopupMenu to delete itself
336 * 338 *
337 */ 339 */
338 else if ( ((BTListItem*)item)->type() == "service") { 340 else if ( ((BTListItem*)item)->type() == "service") {
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");
354 popup = new QPopupMenu(); 356 popup = new QPopupMenu();
355 } 357 }
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/**
379 * Search and display avail. services for a device (on expand from device listing) 382 * Search and display avail. services for a device (on expand from device listing)
380 * @param item the service item returned 383 * @param item the service item returned
381 */ 384 */
382void BlueBase::addServicesToDevice( BTDeviceItem * item ) { 385void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
383 qDebug("addServicesToDevice"); 386 qDebug("addServicesToDevice");
384 // row of mac adress text(3) 387 // row of mac adress text(3)