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

Method addHighlighting

plugins/patchreview/patchreview.cpp:126–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void PatchReviewPlugin::addHighlighting( const QUrl& highlightFile, IDocument* document ) {
127 try {
128 if ( !modelList() )
129 throw "no model";
130
131 for ( int a = 0; a < modelList()->modelCount(); ++a ) {
132 auto* const model = modelList()->modelAt(a);
133 if ( !model )
134 continue;
135
136 QUrl file = urlForFileModel( model );
137
138 if ( file != highlightFile )
139 continue;
140
141 qCDebug(PLUGIN_PATCHREVIEW) << "highlighting" << file.toDisplayString();
142
143 IDocument* doc = document;
144 if( !doc )
145 doc = ICore::self()->documentController()->documentForUrl( file );
146
147 qCDebug(PLUGIN_PATCHREVIEW) << "highlighting file" << file << "with doc" << doc;
148
149 if ( !doc || !doc->textDocument() )
150 continue;
151
152 removeHighlighting( file );
153
154 m_highlighters[file] = new PatchHighlighter(model, doc, this, (qobject_cast<LocalPatchSource*>(m_patch.data()) == nullptr));
155 }
156 } catch ( const QString & str ) {
157 qCDebug(PLUGIN_PATCHREVIEW) << "highlightFile():" << str;
158 } catch ( const char * str ) {
159 qCDebug(PLUGIN_PATCHREVIEW) << "highlightFile():" << str;
160 }
161}
162
163void PatchReviewPlugin::highlightPatch() {
164 try {

Callers

nothing calls this directly

Calls 4

documentForUrlMethod · 0.80
documentControllerMethod · 0.80
textDocumentMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected