Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/Opietooth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/opietooth2/Opietooth.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp index b14cc2f..8323549 100644 --- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp +++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp | |||
@@ -516,118 +516,118 @@ void OTScan::SLOT_DoScan( bool DoIt ) { | |||
516 | // double clicked on a device | 516 | // double clicked on a device |
517 | void OTScan::SLOT_Selected( QListViewItem * it ) { | 517 | void OTScan::SLOT_Selected( QListViewItem * it ) { |
518 | if( ! it ) | 518 | if( ! it ) |
519 | return; | 519 | return; |
520 | 520 | ||
521 | if( Filter.count() > 0 ) { | 521 | if( Filter.count() > 0 ) { |
522 | // filter on service | 522 | // filter on service |
523 | if( it->depth() == 0 ) { | 523 | if( it->depth() == 0 ) { |
524 | // select a service and not a device | 524 | // select a service and not a device |
525 | return; | 525 | return; |
526 | } | 526 | } |
527 | 527 | ||
528 | // store result | 528 | // store result |
529 | SelectedPeer = ((PeerLVI *)it->parent())->peer(); | 529 | SelectedPeer = ((PeerLVI *)it->parent())->peer(); |
530 | SelectedChannel = ((ChannelLVI *)it)->channel(); | 530 | SelectedChannel = ((ChannelLVI *)it)->channel(); |
531 | } else { | 531 | } else { |
532 | // click on device | 532 | // click on device |
533 | if( it->depth() != 0 ) { | 533 | if( it->depth() != 0 ) { |
534 | return; | 534 | return; |
535 | } | 535 | } |
536 | 536 | ||
537 | SelectedPeer = ((PeerLVI *)it)->peer(); | 537 | SelectedPeer = ((PeerLVI *)it)->peer(); |
538 | SelectedChannel = 0; | 538 | SelectedChannel = 0; |
539 | } | 539 | } |
540 | owarn << "Selected " << SelectedPeer->address().toString() << | 540 | odebug << "Selected " << SelectedPeer->address().toString() << |
541 | " Channel " << SelectedChannel << oendl; | 541 | " Channel " << SelectedChannel << oendl; |
542 | emit selected(); | 542 | emit selected(); |
543 | } | 543 | } |
544 | 544 | ||
545 | void OTScan::SLOT_FinishedDetecting( ) { | 545 | void OTScan::SLOT_FinishedDetecting( ) { |
546 | scanMode( false ); | 546 | scanMode( false ); |
547 | } | 547 | } |
548 | 548 | ||
549 | void OTScan::SLOT_CleanupOld( ) { | 549 | void OTScan::SLOT_CleanupOld( ) { |
550 | 550 | ||
551 | // iterate over all peers and find those that | 551 | // iterate over all peers and find those that |
552 | // are down and have no pairing info | 552 | // are down and have no pairing info |
553 | OTPeer * TheP; | 553 | OTPeer * TheP; |
554 | const LinkKeyArray & Keys = OT->getLinkKeys(); | 554 | const LinkKeyArray & Keys = OT->getLinkKeys(); |
555 | 555 | ||
556 | QListViewItem * Lit = DetectedPeers_LV->firstChild(); | 556 | QListViewItem * Lit = DetectedPeers_LV->firstChild(); |
557 | while( Lit ) { | 557 | while( Lit ) { |
558 | TheP = ((PeerLVI *)Lit)->peer(); | 558 | TheP = ((PeerLVI *)Lit)->peer(); |
559 | if( TheP->state() == OTPeer::Peer_Down ) { | 559 | if( TheP->state() == OTPeer::Peer_Down ) { |
560 | unsigned int k; | 560 | unsigned int k; |
561 | 561 | ||
562 | // what about linkkeys ? | 562 | // what about linkkeys ? |
563 | for( k = 0; k < Keys.count(); k ++ ) { | 563 | for( k = 0; k < Keys.count(); k ++ ) { |
564 | if( TheP->address() == Keys[k].to() || | 564 | if( TheP->address() == Keys[k].to() || |
565 | TheP->address() == Keys[k].from() | 565 | TheP->address() == Keys[k].from() |
566 | ) { | 566 | ) { |
567 | // part of linkkey | 567 | // part of linkkey |
568 | owarn << "LINKKEY " << TheP->address().toString() << oendl; | 568 | odebug << "LINKKEY " << TheP->address().toString() << oendl; |
569 | break; | 569 | break; |
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
573 | if( k == Keys.count() ) { | 573 | if( k == Keys.count() ) { |
574 | owarn << "RM LINKKEY " << TheP->address().toString() << oendl; | 574 | odebug << "RM LINKKEY " << TheP->address().toString() << oendl; |
575 | // not found -> remember to remove this peer | 575 | // not found -> remember to remove this peer |
576 | QListViewItem * Nit; | 576 | QListViewItem * Nit; |
577 | OT->removePeer( TheP ); | 577 | OT->removePeer( TheP ); |
578 | Nit = Lit->nextSibling(); | 578 | Nit = Lit->nextSibling(); |
579 | delete Lit; | 579 | delete Lit; |
580 | Lit = Nit; | 580 | Lit = Nit; |
581 | continue; | 581 | continue; |
582 | } | 582 | } |
583 | } else { | 583 | } else { |
584 | owarn << "NODOWN " << TheP->address().toString() << oendl; | 584 | odebug << "NODOWN " << TheP->address().toString() << oendl; |
585 | } | 585 | } |
586 | 586 | ||
587 | Lit = Lit->nextSibling(); | 587 | Lit = Lit->nextSibling(); |
588 | } | 588 | } |
589 | } | 589 | } |
590 | 590 | ||
591 | void OTScan::SLOT_NewPeer( OTPeer * P, bool IsNew ){ | 591 | void OTScan::SLOT_NewPeer( OTPeer * P, bool IsNew ){ |
592 | PeerLVI * it = 0; | 592 | PeerLVI * it = 0; |
593 | 593 | ||
594 | if( IsNew ) { | 594 | if( IsNew ) { |
595 | it = new PeerLVI( P, DetectedPeers_LV ); | 595 | it = new PeerLVI( P, DetectedPeers_LV ); |
596 | } else { | 596 | } else { |
597 | // find peer in table | 597 | // find peer in table |
598 | QListViewItem * Lit = DetectedPeers_LV->firstChild(); | 598 | QListViewItem * Lit = DetectedPeers_LV->firstChild(); |
599 | while( Lit ) { | 599 | while( Lit ) { |
600 | if( ((PeerLVI *)Lit)->peer() == P ) { | 600 | if( ((PeerLVI *)Lit)->peer() == P ) { |
601 | // this item | 601 | // this item |
602 | it = (PeerLVI *)Lit; | 602 | it = (PeerLVI *)Lit; |
603 | break; | 603 | break; |
604 | } | 604 | } |
605 | Lit = Lit->nextSibling(); | 605 | Lit = Lit->nextSibling(); |
606 | } | 606 | } |
607 | 607 | ||
608 | if( ! it ) { | 608 | if( ! it ) { |
609 | owarn << "Should not occur" << oendl; | 609 | odebug << "Should not occur" << oendl; |
610 | return; | 610 | return; |
611 | } | 611 | } |
612 | } | 612 | } |
613 | 613 | ||
614 | // update/show info | 614 | // update/show info |
615 | it->setText( 0, P->name() ); | 615 | it->setText( 0, P->name() ); |
616 | it->setPixmap(0, Icons->deviceIcon( | 616 | it->setPixmap(0, Icons->deviceIcon( |
617 | OT->deviceTypeToName( P->deviceClass() ) ) ); | 617 | OT->deviceTypeToName( P->deviceClass() ) ) ); |
618 | 618 | ||
619 | // tell peer to report its state async | 619 | // tell peer to report its state async |
620 | connect( P, | 620 | connect( P, |
621 | SIGNAL( peerStateReport( OTPeer *)), | 621 | SIGNAL( peerStateReport( OTPeer *)), |
622 | this, | 622 | this, |
623 | SLOT( SLOT_PeerState( OTPeer *)) | 623 | SLOT( SLOT_PeerState( OTPeer *)) |
624 | ); | 624 | ); |
625 | 625 | ||
626 | if( IsNew ) { | 626 | if( IsNew ) { |
627 | // find state | 627 | // find state |
628 | refreshState( (PeerLVI *)it, 1 ); | 628 | refreshState( (PeerLVI *)it, 1 ); |
629 | } else { | 629 | } else { |
630 | // update staet | 630 | // update staet |
631 | SLOT_PeerState( P ); | 631 | SLOT_PeerState( P ); |
632 | } | 632 | } |
633 | } | 633 | } |
@@ -908,49 +908,49 @@ OTManage::OTManage( QWidget * parent, OTIcons * _IC ) : | |||
908 | 908 | ||
909 | AllDrivers_LV->header()->hide(); | 909 | AllDrivers_LV->header()->hide(); |
910 | } | 910 | } |
911 | 911 | ||
912 | OTManage::~OTManage() { | 912 | OTManage::~OTManage() { |
913 | if( MyIcons ) | 913 | if( MyIcons ) |
914 | delete Icons; | 914 | delete Icons; |
915 | OTGateway::releaseOTGateway(); | 915 | OTGateway::releaseOTGateway(); |
916 | } | 916 | } |
917 | 917 | ||
918 | void OTManage::SLOT_ShowDriver( QListViewItem * It ) { | 918 | void OTManage::SLOT_ShowDriver( QListViewItem * It ) { |
919 | if( It == 0 || It->depth() > 0 ) | 919 | if( It == 0 || It->depth() > 0 ) |
920 | // not toplevel | 920 | // not toplevel |
921 | return; | 921 | return; |
922 | 922 | ||
923 | DriverLVI * it = (DriverLVI *) It; | 923 | DriverLVI * it = (DriverLVI *) It; |
924 | DriverIsUp_CB->setChecked( it->driver()->isUp() ); | 924 | DriverIsUp_CB->setChecked( it->driver()->isUp() ); |
925 | } | 925 | } |
926 | 926 | ||
927 | void OTManage::SLOT_UpDriver( bool Up ) { | 927 | void OTManage::SLOT_UpDriver( bool Up ) { |
928 | QListViewItem * it = AllDrivers_LV->firstChild(); | 928 | QListViewItem * it = AllDrivers_LV->firstChild(); |
929 | while( it ) { | 929 | while( it ) { |
930 | if( it->isSelected() ) { | 930 | if( it->isSelected() ) { |
931 | OTDriver * D = ((DriverLVI *)it)->driver(); | 931 | OTDriver * D = ((DriverLVI *)it)->driver(); |
932 | owarn << "UP driver " << D->devname() << oendl; | 932 | odebug << "UP driver " << D->devname() << oendl; |
933 | // this | 933 | // this |
934 | D->setUp( Up ); | 934 | D->setUp( Up ); |
935 | return; | 935 | return; |
936 | } | 936 | } |
937 | it = it->nextSibling(); | 937 | it = it->nextSibling(); |
938 | } | 938 | } |
939 | } | 939 | } |
940 | 940 | ||
941 | void OTManage::SLOT_StateChange( OTDriver * D, bool Up ) { | 941 | void OTManage::SLOT_StateChange( OTDriver * D, bool Up ) { |
942 | QListViewItem * it = AllDrivers_LV->firstChild(); | 942 | QListViewItem * it = AllDrivers_LV->firstChild(); |
943 | while( it ) { | 943 | while( it ) { |
944 | if( ((DriverLVI *)it)->driver() == D ) { | 944 | if( ((DriverLVI *)it)->driver() == D ) { |
945 | it->setPixmap( 0, | 945 | it->setPixmap( 0, |
946 | Icons->loadPixmap( ( Up ) ? "bluezon" : "bluezoff" ) ); | 946 | Icons->loadPixmap( ( Up ) ? "bluezon" : "bluezoff" ) ); |
947 | return; | 947 | return; |
948 | } | 948 | } |
949 | it = it->nextSibling(); | 949 | it = it->nextSibling(); |
950 | } | 950 | } |
951 | } | 951 | } |
952 | 952 | ||
953 | void OTManage::SLOT_DriverListChanged( ) { | 953 | void OTManage::SLOT_DriverListChanged( ) { |
954 | DriverLVI * It; | 954 | DriverLVI * It; |
955 | QListViewItem * Sub; | 955 | QListViewItem * Sub; |
956 | QListViewItem * First = 0; | 956 | QListViewItem * First = 0; |