* @brief Reads a Qt resource into a QString, returning empty on failure. */
| 22 | * @brief Reads a Qt resource into a QString, returning empty on failure. |
| 23 | */ |
| 24 | static QString readResource(const QString& path) |
| 25 | { |
| 26 | QFile file(path); |
| 27 | if (!file.open(QIODevice::ReadOnly)) { |
| 28 | qCWarning(AI::serialStudioAI) << "Resource not readable:" << path; |
| 29 | return {}; |
| 30 | } |
| 31 | |
| 32 | const auto data = file.readAll(); |
| 33 | file.close(); |
| 34 | return QString::fromUtf8(data); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @brief Neutralizes any forged <untrusted> delimiter inside untrusted payload text. |
no test coverage detected