* @brief Loads the cover logo as inline SVG or a base64 data URI img tag. */
| 306 | * @brief Loads the cover logo as inline SVG or a base64 data URI img tag. |
| 307 | */ |
| 308 | QString Sessions::HtmlReport::buildCoverLogoMarkup() const |
| 309 | { |
| 310 | if (m_opts.logoPath.isEmpty() || !QFileInfo::exists(m_opts.logoPath)) |
| 311 | return QString(); |
| 312 | |
| 313 | const QFileInfo fi(m_opts.logoPath); |
| 314 | const bool isSvg = fi.suffix().compare("svg", Qt::CaseInsensitive) == 0; |
| 315 | if (!isSvg) { |
| 316 | const QString dataUri = encodeLogoAsDataUri(m_opts.logoPath); |
| 317 | if (dataUri.isEmpty()) |
| 318 | return QString(); |
| 319 | |
| 320 | return QStringLiteral("<img src=\"%1\" alt=\"\">").arg(dataUri); |
| 321 | } |
| 322 | |
| 323 | QString markup = readResource(m_opts.logoPath); |
| 324 | if (!markup.isEmpty()) |
| 325 | return markup; |
| 326 | |
| 327 | QFile f(m_opts.logoPath); |
| 328 | if (f.open(QIODevice::ReadOnly)) |
| 329 | markup = QString::fromUtf8(f.readAll()); |
| 330 | |
| 331 | return markup; |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * @brief Builds the first-page cover fragment: logo, company, title, subtitle. |
nothing calls this directly
no test coverage detected