| 59 | |
| 60 | template<class Style> |
| 61 | static void writeEntry(KConfigGroup& sourceFormatterConfig, const QMimeType& mimeType, const QString& formatterName, |
| 62 | const Style* style) |
| 63 | { |
| 64 | if (style) { |
| 65 | QString entry = formatterName + delimiter + style->name(); |
| 66 | sourceFormatterConfig.writeEntry(mimeType.name(), std::move(entry)); |
| 67 | } else { |
| 68 | sourceFormatterConfig.deleteEntry(mimeType.name()); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | private: |
| 73 | static constexpr QLatin1String delimiter{"||", 2}; |