Changeset View
Changeset View
Standalone View
Standalone View
formatters/astyle/astyle_plugin.cpp
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 82 | { | |||
---|---|---|---|---|---|
83 | m_formatter->loadStyle( s.content() ); | 83 | m_formatter->loadStyle( s.content() ); | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | return m_formatter->formatSource(text, leftContext, rightContext); | 86 | return m_formatter->formatSource(text, leftContext, rightContext); | ||
87 | } | 87 | } | ||
88 | 88 | | |||
89 | QString AStylePlugin::formatSource(const QString& text, const QUrl &url, const QMimeType& mime, const QString& leftContext, const QString& rightContext) | 89 | QString AStylePlugin::formatSource(const QString& text, const QUrl &url, const QMimeType& mime, const QString& leftContext, const QString& rightContext) | ||
90 | { | 90 | { | ||
91 | return formatSourceWithStyle( ICore::self()->sourceFormatterController()->styleForMimeType( mime ), text, url, mime, leftContext, rightContext ); | 91 | auto style = ICore::self()->sourceFormatterController()->styleForUrl(url, mime); | ||
92 | return formatSourceWithStyle(style, text, url, mime, leftContext, rightContext); | ||||
92 | } | 93 | } | ||
93 | 94 | | |||
94 | static SourceFormatterStyle::MimeList supportedMimeTypes() | 95 | static SourceFormatterStyle::MimeList supportedMimeTypes() | ||
95 | { | 96 | { | ||
96 | return { | 97 | return { | ||
97 | {QStringLiteral("text/x-c++src"), QStringLiteral("C++")}, | 98 | {QStringLiteral("text/x-c++src"), QStringLiteral("C++")}, | ||
98 | {QStringLiteral("text/x-chdr"), QStringLiteral("C")}, | 99 | {QStringLiteral("text/x-chdr"), QStringLiteral("C")}, | ||
99 | {QStringLiteral("text/x-c++hdr"), QStringLiteral("C++")}, | 100 | {QStringLiteral("text/x-c++hdr"), QStringLiteral("C++")}, | ||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |