| 358 | } |
| 359 | |
| 360 | void SourceFormatterController::unloadingPlugin(IPlugin* plugin) |
| 361 | { |
| 362 | Q_D(SourceFormatterController); |
| 363 | |
| 364 | auto* sourceFormatter = plugin->extension<ISourceFormatter>(); |
| 365 | |
| 366 | if (!sourceFormatter || !d->enabled) { |
| 367 | return; |
| 368 | } |
| 369 | |
| 370 | const int idx = d->sourceFormatters.indexOf(sourceFormatter); |
| 371 | Q_ASSERT(idx != -1); |
| 372 | d->sourceFormatters.remove(idx); |
| 373 | |
| 374 | resetUi(); |
| 375 | |
| 376 | emit formatterUnloading(sourceFormatter); |
| 377 | if (d->sourceFormatters.isEmpty()) { |
| 378 | emit hasFormattersChanged(false); |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | |
| 383 | void SourceFormatterController::initialize() |