| 463 | } |
| 464 | |
| 465 | void OSDFontPickerDialog::onDialogAccepted() |
| 466 | { |
| 467 | if (!m_selected_system_family.trimmed().isEmpty()) |
| 468 | { |
| 469 | const QString resolved_path = resolveSystemFontPath(m_selected_system_family); |
| 470 | if (!resolved_path.isEmpty() && !pathsReferToSameFile(m_selected_font_path, resolved_path)) |
| 471 | { |
| 472 | setSelectedFontPath(resolved_path); |
| 473 | m_ui.status->setText(tr("Using system font: %1.").arg(m_selected_system_family)); |
| 474 | } |
| 475 | else if (resolved_path.isEmpty()) |
| 476 | { |
| 477 | m_ui.status->setText( |
| 478 | tr("Could not locate a font file for system family '%1'. Using bundled default.").arg(m_selected_system_family)); |
| 479 | setSelectedFontPath(QString()); |
| 480 | } |
| 481 | } |
| 482 | else if (CatalogFontEntry* entry = getSelectedCatalogEntry()) |
| 483 | { |
| 484 | const QString cached_font_path = findCachedFamilyFontPath(entry->family); |
| 485 | if (!cached_font_path.isEmpty() && !pathsReferToSameFile(m_selected_font_path, cached_font_path)) |
| 486 | setSelectedFontPath(cached_font_path); |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | bool OSDFontPickerDialog::ensureCatalogLoaded(bool allow_download, bool force_download) |
| 491 | { |
nothing calls this directly
no test coverage detected