summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-07-09 13:42:36 (UTC)
committer mickeyl <mickeyl>2005-07-09 13:42:36 (UTC)
commit5dbfa604bcc5dd32401d862372af806bfe674e89 (patch) (unidiff)
tree38abbfa6cf68bca36ce397e5e1e69c12f8674dc2
parent7bccb3143fbfb4dd70cc22d5233e6275245d0285 (diff)
downloadopie-5dbfa604bcc5dd32401d862372af806bfe674e89.zip
opie-5dbfa604bcc5dd32401d862372af806bfe674e89.tar.gz
opie-5dbfa604bcc5dd32401d862372af806bfe674e89.tar.bz2
- sanitize 'ret' scoping
- fix orthography in popupmenu - remove 'add to group', since groups seem unfinished :/
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 7954cc3..af1cd23 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -309,54 +309,50 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ )
309{} 309{}
310 310
311 311
312/** 312/**
313 * Action that are toggled on hold (mostly QPopups i guess) 313 * Action that are toggled on hold (mostly QPopups i guess)
314 */ 314 */
315void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) 315void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ )
316{ 316{
317 if (!item ) 317 if (!item )
318 return; 318 return;
319 319
320 QPopupMenu *menu = new QPopupMenu(); 320 QPopupMenu *menu = new QPopupMenu();
321 int ret=0;
322 321
323 if ( ((BTListItem*)item)->type() == "device") 322 if ( static_cast<BTListItem*>( item )->type() == "device")
324 { 323 {
325
326 QPopupMenu *groups = new QPopupMenu(); 324 QPopupMenu *groups = new QPopupMenu();
327 325
328 menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); 326 menu->insertItem( static_cast<BTDeviceItem*>( item )->name(), 0 );
329 menu->insertSeparator(1); 327 menu->insertSeparator(1);
330 menu->insertItem( tr("rescan sevices"), 2); 328 menu->insertItem( tr( "&Rescan services" ), 2);
331 menu->insertItem( tr("to group"), groups , 3); 329 // menu->insertItem( tr( "&Add to group" ), groups, 3);
332 menu->insertItem( tr("delete"), 4); 330 menu->insertItem( tr( "&Delete"), 4);
333 331 int ret = menu->exec( point, 0);
334 ret = menu->exec( point , 0);
335 332
336 switch(ret) 333 switch(ret)
337 { 334 {
338 case -1: 335 case -1:
339 break; 336 break;
340 case 2: 337 case 2:
341 addServicesToDevice( (BTDeviceItem*)item ); 338 addServicesToDevice( static_cast<BTDeviceItem*>( item ) );
342 break; 339 break;
343 340
344 case 4: 341 case 4:
345 // deletes childs too 342 // deletes childs too
346 delete item; 343 delete item;
347 break; 344 break;
348 } 345 }
349 delete groups; 346 // delete groups;
350
351 } 347 }
352 348
353 /* 349 /*
354 * We got service sensitive PopupMenus in our factory 350 * We got service sensitive PopupMenus in our factory
355 * We will create one through the factory and will insert 351 * We will create one through the factory and will insert
356 * our Separator + ShowInfo into the menu or create a new 352 * our Separator + ShowInfo into the menu or create a new
357 * one if the factory returns 0 353 * one if the factory returns 0
358 * PopupMenu deletion is kind of weird. 354 * PopupMenu deletion is kind of weird.
359 * If escaped( -1 ) or any of our items were chosen we'll 355 * If escaped( -1 ) or any of our items were chosen we'll
360 * delete the PopupMenu otherwise it's the responsibility of 356 * delete the PopupMenu otherwise it's the responsibility of
361 * the PopupMenu to delete itself 357 * the PopupMenu to delete itself
362 * 358 *
@@ -377,25 +373,25 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
377 else 373 else
378 { 374 {
379 owarn << "Empty" << oendl; 375 owarn << "Empty" << oendl;
380 } 376 }
381 377
382 if ( popup == 0l ) 378 if ( popup == 0l )
383 { 379 {
384 owarn << "factory returned 0l" << oendl; 380 owarn << "factory returned 0l" << oendl;
385 popup = new QPopupMenu(); 381 popup = new QPopupMenu();
386 } 382 }
387 int test1 = popup->insertItem( tr("Test1:"), 2); 383 int test1 = popup->insertItem( tr("Test1:"), 2);
388 384
389 ret = popup->exec( point ); 385 int ret = popup->exec( point );
390 owarn << "returned from exec() " << oendl; 386 owarn << "returned from exec() " << oendl;
391 if ( ret == -1 ) 387 if ( ret == -1 )
392 { 388 {
393 ; 389 ;
394 } 390 }
395 else if ( ret == test1 ) 391 else if ( ret == test1 )
396 { 392 {
397 ; 393 ;
398 } 394 }
399 delete popup; 395 delete popup;
400 } 396 }
401 delete menu; 397 delete menu;