* @brief Builds the data-tables summary array used by project.snapshot. */
| 3793 | * @brief Builds the data-tables summary array used by project.snapshot. |
| 3794 | */ |
| 3795 | static QJsonArray buildSnapshotTables(const DataModel::ProjectModel& pm) |
| 3796 | { |
| 3797 | QJsonArray tables; |
| 3798 | for (const auto& t : pm.tables()) { |
| 3799 | QJsonObject tbl; |
| 3800 | tbl[Keys::Title] = t.name; |
| 3801 | tbl[QStringLiteral("registerCount")] = static_cast<int>(t.registers.size()); |
| 3802 | |
| 3803 | const auto constants = std::count_if(t.registers.begin(), t.registers.end(), [](const auto& r) { |
| 3804 | return r.type == DataModel::RegisterType::Constant; |
| 3805 | }); |
| 3806 | const auto computed = std::count_if(t.registers.begin(), t.registers.end(), [](const auto& r) { |
| 3807 | return r.type == DataModel::RegisterType::Computed; |
| 3808 | }); |
| 3809 | |
| 3810 | tbl[QStringLiteral("constantCount")] = static_cast<int>(constants); |
| 3811 | tbl[QStringLiteral("computedCount")] = static_cast<int>(computed); |
| 3812 | tables.append(tbl); |
| 3813 | } |
| 3814 | return tables; |
| 3815 | } |
| 3816 | |
| 3817 | /** |
| 3818 | * @brief Returns project.snapshot's caller hint, with a bulk-edit nudge above 10 datasets. |
no test coverage detected