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

Method documentClosed

plugins/problemreporter/problemreporterplugin.cpp:135–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void ProblemReporterPlugin::documentClosed(IDocument* doc)
136{
137 if (!doc->textDocument())
138 return;
139
140 const IndexedString url(doc->url());
141
142 const auto it = m_visualizers.constFind(url);
143 if (it == m_visualizers.cend()) {
144 qCDebug(PLUGIN_PROBLEMREPORTER) << "closed an unregistered text document:" << doc << doc->url().toString();
145 return;
146 }
147
148 if (it.value()->document() != doc->textDocument()) {
149 // doc is being renamed, DocumentControllerPrivate::changeDocumentUrl() is closing it
150 // because of a conflict with another open modified document at doc's new URL.
151 // documentUrlChanged(doc, ...) will be invoked soon and will remove doc's visualizer. Nothing to do here.
152 qCDebug(PLUGIN_PROBLEMREPORTER) << "closed a text document that shares another text document's URL:" << doc
153 << doc->url().toString();
154 return;
155 }
156
157 delete it.value();
158 m_visualizers.erase(it);
159 m_reHighlightNeeded.remove(url);
160}
161
162void ProblemReporterPlugin::textDocumentCreated(KDevelop::IDocument* document)
163{

Callers

nothing calls this directly

Calls 7

textDocumentMethod · 0.45
urlMethod · 0.45
constFindMethod · 0.45
toStringMethod · 0.45
documentMethod · 0.45
valueMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected