| 315 | } |
| 316 | |
| 317 | SettingsWidgetPtr AStylePlugin::editStyleWidget(const QMimeType& mime) const |
| 318 | { |
| 319 | AStylePreferences::Language lang = AStylePreferences::CPP; |
| 320 | if (mime.inherits(QStringLiteral("text/x-java"))) |
| 321 | lang = AStylePreferences::Java; |
| 322 | else if (mime.inherits(QStringLiteral("text/x-csharp"))) |
| 323 | lang = AStylePreferences::CSharp; |
| 324 | else if (mime.inherits(QStringLiteral("text/x-objcsrc")) || mime.inherits(QStringLiteral("text/x-objc++src"))) { |
| 325 | // x-objc++src *should* inherit x-objcsrc but that is not always the case in practice |
| 326 | lang = AStylePreferences::ObjC; |
| 327 | } |
| 328 | return SettingsWidgetPtr{new AStylePreferences(lang)}; |
| 329 | } |
| 330 | |
| 331 | QString AStylePlugin::previewText(const SourceFormatterStyle& /*style*/, const QMimeType& mime) const |
| 332 | { |