| 238 | } |
| 239 | |
| 240 | void MessageWidget::startAutoHideTimer() |
| 241 | { |
| 242 | // message does not want autohide, or timer already running |
| 243 | if (!m_currentMessage // no message, nothing to do |
| 244 | || m_autoHideTime < 0 // message does not want auto-hide |
| 245 | || m_autoHideTimer->isActive() // auto-hide timer is already active |
| 246 | || m_messageWidget->isHideAnimationRunning() // widget is in hide animation phase |
| 247 | || m_messageWidget->isShowAnimationRunning() // widget is in show animation phase |
| 248 | ) { |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | // safety checks: the message must still be valid |
| 253 | Q_ASSERT(m_messageQueue.size()); |
| 254 | Q_ASSERT(m_currentMessage->autoHide() == m_autoHideTime); |
| 255 | |
| 256 | // start autoHide timer as requested |
| 257 | m_autoHideTimer->start(m_autoHideTime == 0 ? s_defaultAutoHideTime : m_autoHideTime); |
| 258 | } |
| 259 | |
| 260 | void MessageWidget::linkHovered(const QString &link) |
| 261 | { |