Changeset 6132 for trunk/qt4-gui/src/contactlist
- Timestamp:
- 04/07/08 04:33:22 (8 months ago)
- Files:
-
- 1 modified
-
trunk/qt4-gui/src/contactlist/contactuserdata.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/contactlist/contactuserdata.cpp
r6112 r6132 99 99 { 100 100 // Free up animation timer resource if we were using it 101 myFlash = false; 102 myOnlCounter = 0; 103 myCarCounter = 0; 104 stopAnimation(); 101 if (myFlash || myOnlCounter > 0 || myCarCounter > 0) 102 stopAnimation(); 105 103 106 104 // Remove this user from all groups … … 119 117 if (sig->Argument() == 0) 120 118 { 121 // User came online119 // User fetched our auto respons message 122 120 myCarCounter = ((5*1000/FLASH_TIME)+1)&(-2); 123 121 startAnimation(); … … 129 127 if (sig->Argument() == 1) 130 128 { 131 // User fetched our auto respons message129 // User came online 132 130 myOnlCounter = 5*1000/FLASH_TIME; // run about 5 seconds 133 131 startAnimation(); … … 495 493 { 496 494 // Start common timer if not already running 497 if ( myAnimatorCount == 0)495 if (!myAnimateTimer->isActive()) 498 496 myAnimateTimer->start(); 499 497 … … 509 507 void ContactUserData::stopAnimation() 510 508 { 511 myAnimating = myFlash || myOnlCounter || myCarCounter; 512 513 // If this was the only or last animation disconnect from timer 514 if (!myAnimating) 515 { 516 disconnect(myAnimateTimer, SIGNAL(timeout()), this, SLOT(animate())); 517 myAnimatorCount--; 518 519 // Stop animation timer if noone is using it anymore 520 if (myAnimatorCount == 0) 521 myAnimateTimer->stop(); 522 } 509 // Disconnect from timer and keep track of usage 510 disconnect(myAnimateTimer, SIGNAL(timeout()), this, SLOT(animate())); 511 myAnimatorCount--; 512 513 // Stop animation timer if noone is using it anymore 514 if (myAnimatorCount == 0) 515 myAnimateTimer->stop(); 516 517 myAnimating = false; 523 518 } 524 519 … … 538 533 539 534 // Release timer if this was last animation 540 stopAnimation(); 535 if (!myFlash && myOnlCounter == 0 && myCarCounter == 0) 536 stopAnimation(); 541 537 542 538 // data() will check the counter value to determine which icon to show so nothing to do here except triggering an update
