* @brief Decrements a RepeatNTimes counter and stops the timer when it hits zero. */
| 101 | * @brief Decrements a RepeatNTimes counter and stops the timer when it hits zero. |
| 102 | */ |
| 103 | static void tickRepeatTimer(int index, QMap<int, QTimer*>& timers, QMap<int, int>& counters) |
| 104 | { |
| 105 | const auto it = counters.find(index); |
| 106 | if (it == counters.end()) |
| 107 | return; |
| 108 | |
| 109 | if (--it.value() > 0) |
| 110 | return; |
| 111 | |
| 112 | const auto timerIt = timers.find(index); |
| 113 | if (timerIt != timers.end() && timerIt.value()) |
| 114 | timerIt.value()->stop(); |
| 115 | |
| 116 | counters.erase(it); |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * @brief Applies a non-RepeatNTimes timer mode to an action's QTimer. |
no test coverage detected