| 341 | } |
| 342 | |
| 343 | AStylePlugin::Indentation AStylePlugin::indentation(const SourceFormatterStyle& style, const QUrl& url, |
| 344 | const QMimeType& mime) const |
| 345 | { |
| 346 | // Call formatSourceWithStyle() first to initialize the m_formatter data structures according to the arguments. |
| 347 | formatSourceWithStyle(style, QString(), url, mime, QString(), QString()); |
| 348 | |
| 349 | Indentation ret; |
| 350 | |
| 351 | ret.indentWidth = m_formatter->option(QStringLiteral("FillCount")).toInt(); |
| 352 | |
| 353 | QString s = m_formatter->option(QStringLiteral("Fill")).toString(); |
| 354 | if(s == QLatin1String("Tabs")) |
| 355 | { |
| 356 | // Do tabs-only indentation |
| 357 | ret.indentationTabWidth = ret.indentWidth; |
| 358 | }else{ |
| 359 | // Don't use tabs at all |
| 360 | ret.indentationTabWidth = -1; |
| 361 | } |
| 362 | |
| 363 | return ret; |
| 364 | } |
| 365 | |
| 366 | QString AStylePlugin::formattingSample(AStylePreferences::Language lang) |
| 367 | { |
no test coverage detected