| 1544 | //----------------------------------------------------------------------------- |
| 1545 | |
| 1546 | void GuiControl::setTooltipProfile( GuiControlProfile *prof ) |
| 1547 | { |
| 1548 | AssertFatal( prof, "GuiControl::setTooltipProfile: invalid profile" ); |
| 1549 | |
| 1550 | if ( prof == mTooltipProfile ) |
| 1551 | return; |
| 1552 | |
| 1553 | bool skipAwaken = false; |
| 1554 | |
| 1555 | if ( mTooltipProfile == NULL ) |
| 1556 | skipAwaken = true; |
| 1557 | |
| 1558 | if( mTooltipProfile ) |
| 1559 | mTooltipProfile->decUseCount(); |
| 1560 | |
| 1561 | if ( mAwake && mTooltipProfile ) |
| 1562 | mTooltipProfile->decLoadCount(); |
| 1563 | |
| 1564 | // Clear the delete notification we previously set up |
| 1565 | if ( mTooltipProfile ) |
| 1566 | clearNotify( mTooltipProfile ); |
| 1567 | |
| 1568 | mTooltipProfile = prof; |
| 1569 | mTooltipProfile->incUseCount(); |
| 1570 | if ( mAwake ) |
| 1571 | mTooltipProfile->incLoadCount(); |
| 1572 | |
| 1573 | // Make sure that the new profile will notify us when it is deleted |
| 1574 | if ( mTooltipProfile ) |
| 1575 | deleteNotify( mTooltipProfile ); |
| 1576 | |
| 1577 | // force an update when the profile is changed |
| 1578 | if ( mAwake && !skipAwaken ) |
| 1579 | { |
| 1580 | sleep(); |
| 1581 | |
| 1582 | if( !Sim::isShuttingDown() ) |
| 1583 | awaken(); |
| 1584 | } |
| 1585 | } |
| 1586 | |
| 1587 | //----------------------------------------------------------------------------- |
| 1588 |
no test coverage detected