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

Method showDocumentation

kdevplatform/documentation/documentationview.cpp:207–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void DocumentationView::showDocumentation(const IDocumentation::Ptr& doc)
208{
209 qCDebug(DOCUMENTATION) << "showing" << doc->name();
210
211 mBack->setEnabled(!mHistory.isEmpty());
212 mForward->setEnabled(false);
213
214 // clear all history following the current item, unless we're already
215 // at the end (otherwise this code crashes when history is empty, which
216 // happens when addHistory is first called on startup to add the
217 // homepage)
218 if (mCurrent+1 < mHistory.end()) {
219 mHistory.erase(mCurrent+1, mHistory.end());
220 }
221
222 mHistory.append(doc);
223 mCurrent = mHistory.end()-1;
224
225 // NOTE: we assume an existing widget was used to navigate somewhere
226 // but this history entry actually contains the new info for the
227 // title... this is ugly and should be refactored somehow
228 if (mIdentifiers->completer()->model() == (*mCurrent)->provider()->indexModel()) {
229 mIdentifiers->setText((*mCurrent)->name());
230 }
231
232 updateView();
233}
234
235void DocumentationView::emptyHistory()
236{

Callers

nothing calls this directly

Calls 9

nameMethod · 0.45
setEnabledMethod · 0.45
isEmptyMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
modelMethod · 0.45
indexModelMethod · 0.45
providerMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected