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

Method documentLoaded

kdevplatform/shell/sourceformattercontroller.cpp:273–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273void SourceFormatterController::documentLoaded(const QPointer<TextDocument>& doc)
274{
275 Q_D(const SourceFormatterController);
276
277 // NOTE: explicitly check this here to prevent crashes on shutdown
278 // when this slot gets called (note: delayed connection)
279 // but the text document was already destroyed
280 // there have been unit tests that failed due to that...
281 if (!doc || !doc->textDocument()) {
282 return;
283 }
284 FileFormatter ff(*doc);
285 if (ff.readFormatterAndStyle(d->sourceFormatters)) {
286 ff.adaptEditorIndentationMode(doc->textDocument());
287 }
288}
289
290void SourceFormatterController::FileFormatter::projectOpened(const IProject& project,
291 const QVector<ISourceFormatter*>& formatters)

Callers

nothing calls this directly

Calls 3

readFormatterAndStyleMethod · 0.80
textDocumentMethod · 0.45

Tested by

no test coverage detected