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

Method ColorCache

kdevplatform/language/highlighting/colorcache.cpp:77–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77ColorCache::ColorCache(QObject* parent)
78 : QObject(parent)
79 , m_defaultColors(new ConfigurableHighlightingColors)
80 , m_validColorCount(0)
81 , m_localColorRatio(0)
82 , m_globalColorRatio(0)
83 , m_globalColorSource(ICompletionSettings::GlobalColorSource::AutoGenerated)
84 , m_boldDeclarations(true)
85{
86 Q_ASSERT(m_self == nullptr);
87
88 updateColorsFromScheme(); // default / fallback
89 updateColorsFromSettings();
90
91 connect(ICore::self()->languageController()->completionSettings(), &ICompletionSettings::settingsChanged,
92 this, &ColorCache::updateColorsFromSettings, Qt::QueuedConnection);
93
94 connect(ICore::self()->documentController(), &IDocumentController::documentActivated,
95 this, &ColorCache::slotDocumentActivated);
96
97 bool hadDoc = tryActiveDocument();
98
99 updateInternal();
100
101 m_self = this;
102
103 if (!hadDoc) {
104 // try to update later on again
105 QMetaObject::invokeMethod(this, "tryActiveDocument", Qt::QueuedConnection);
106 }
107}
108
109bool ColorCache::tryActiveDocument()
110{

Callers

nothing calls this directly

Calls 3

completionSettingsMethod · 0.80
languageControllerMethod · 0.80
documentControllerMethod · 0.80

Tested by

no test coverage detected