> Assuming you have a KTextEditor::Document around, the right way to do it > would be: > KTextEditor::VariableInterface* iface = > qobject_cast(doc); > > if (iface) { > QString indentWidth = iface->variable("indent-width"); > ... > } > In other words, you can query the documents for arbitrary variables. You > don't have to parse it yourself, it's for free. If the document is opened in KDevelop, one can do IDocument *doc = ICore::self()->documentController()->documentForUrl(url); KTextEditor::Document *textdoc = doc->textDocument(); but I'd assume source formatter plugin also needs to reformat the files which aren't opened (like all files in the project)?