| 458 | } |
| 459 | |
| 460 | bool SourceFormatterController::FileFormatter::readFormatterAndStyle(const QVector<ISourceFormatter*>& formatters) |
| 461 | { |
| 462 | Q_ASSERT_X(!m_sourceFormatterConfig.isValid() && !m_formatter && m_style.name().isEmpty(), Q_FUNC_INFO, |
| 463 | "This reinitialization must be a mistake."); |
| 464 | |
| 465 | if (formatters.empty()) { |
| 466 | return false; |
| 467 | } |
| 468 | |
| 469 | m_sourceFormatterConfig = Config::configForUrl(m_url); |
| 470 | |
| 471 | const auto data = Config::readFormatterData(m_sourceFormatterConfig, m_mimeType.name(), formatters); |
| 472 | if (!data.isValid()) { |
| 473 | return false; |
| 474 | } |
| 475 | |
| 476 | m_formatter = data.formatter; |
| 477 | m_style = data.style(); |
| 478 | return true; |
| 479 | } |
| 480 | |
| 481 | QString SourceFormatterController::FileFormatter::formatterCaption() const |
| 482 | { |
no test coverage detected