| 1295 | } |
| 1296 | |
| 1297 | void ContextBrowserPlugin::openDocument(int historyIndex) |
| 1298 | { |
| 1299 | Q_ASSERT_X(historyIndex >= 0, "openDocument", "negative history index"); |
| 1300 | Q_ASSERT_X(historyIndex < m_history.size(), "openDocument", "history index out of range"); |
| 1301 | DocumentCursor c = m_history[historyIndex].computePosition(); |
| 1302 | if (c.isValid() && !c.document.str().isEmpty()) { |
| 1303 | disconnect( |
| 1304 | ICore::self()->documentController(), &IDocumentController::documentJumpPerformed, this, |
| 1305 | &ContextBrowserPlugin::documentJumpPerformed); |
| 1306 | |
| 1307 | ICore::self()->documentController()->openDocument(c.document.toUrl(), c); |
| 1308 | |
| 1309 | connect( |
| 1310 | ICore::self()->documentController(), &IDocumentController::documentJumpPerformed, this, |
| 1311 | &ContextBrowserPlugin::documentJumpPerformed); |
| 1312 | |
| 1313 | KDevelop::DUChainReadLocker lock(KDevelop::DUChain::lock()); |
| 1314 | updateDeclarationListBox(m_history[historyIndex].context.data()); |
| 1315 | } |
| 1316 | } |
| 1317 | |
| 1318 | void ContextBrowserPlugin::historyPrevious() |
| 1319 | { |