MCPcopy Create free account
hub / github.com/KDE/kdevelop / indentation

Method indentation

plugins/astyle/astyle_plugin.cpp:343–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343AStylePlugin::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
366QString AStylePlugin::formattingSample(AStylePreferences::Language lang)
367{

Callers 4

addModelineMethod · 0.45
drawBranchesMethod · 0.45

Calls 4

toIntMethod · 0.80
QStringClass · 0.50
optionMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected