| 271 | } |
| 272 | |
| 273 | void 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 | |
| 290 | void SourceFormatterController::FileFormatter::projectOpened(const IProject& project, |
| 291 | const QVector<ISourceFormatter*>& formatters) |
nothing calls this directly
no test coverage detected