* @brief Returns a list of available dashboard actions with their metadata. */
| 551 | * @brief Returns a list of available dashboard actions with their metadata. |
| 552 | */ |
| 553 | QVariantList UI::Dashboard::actions() const |
| 554 | { |
| 555 | QVariantList actions; |
| 556 | for (int i = 0; i < m_actions.count(); ++i) { |
| 557 | const auto& action = m_actions[i]; |
| 558 | |
| 559 | QVariantMap m; |
| 560 | m["id"] = i; |
| 561 | m["checked"] = false; |
| 562 | m["text"] = action.title; |
| 563 | m["icon"] = Misc::IconEngine::resolveActionIconSource(action.icon); |
| 564 | if (action.timerMode == DataModel::TimerMode::ToggleOnTrigger) { |
| 565 | if (m_timers.contains(i) && m_timers[i] && m_timers[i]->isActive()) |
| 566 | m["checked"] = true; |
| 567 | } |
| 568 | |
| 569 | actions.append(m); |
| 570 | } |
| 571 | |
| 572 | return actions; |
| 573 | } |
| 574 | |
| 575 | /** |
| 576 | * @brief Returns the runtime index of the action with the given public @p actionId, or -1. |
no test coverage detected