| 353 | } |
| 354 | |
| 355 | void ColorCache::updateInternal() |
| 356 | { |
| 357 | ifDebug(qCDebug(LANGUAGE) << "update internal" << m_self; ) |
| 358 | generateColors(); |
| 359 | |
| 360 | if (!m_self) { |
| 361 | // don't do anything else fancy on startup |
| 362 | return; |
| 363 | } |
| 364 | |
| 365 | emit colorsGotChanged(); |
| 366 | |
| 367 | // rehighlight open documents |
| 368 | if (!ICore::self() || ICore::self()->shuttingDown()) { |
| 369 | return; |
| 370 | } |
| 371 | const auto documents = ICore::self()->documentController()->openDocuments(); |
| 372 | for (IDocument* doc : documents) { |
| 373 | const auto languages = ICore::self()->languageController()->languagesForUrl(doc->url()); |
| 374 | for (const auto lang : languages) { |
| 375 | ReferencedTopDUContext top; |
| 376 | { |
| 377 | DUChainReadLocker lock; |
| 378 | top = lang->standardContext(doc->url()); |
| 379 | } |
| 380 | |
| 381 | if (top) { |
| 382 | if (ICodeHighlighting* highlighting = lang->codeHighlighting()) { |
| 383 | highlighting->highlightDUChain(top); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | QColor ColorCache::blend(QColor color, uchar ratio) const |
| 391 | { |
nothing calls this directly
no test coverage detected