ui: scope names in snippet titles

* added title for snippets
* title displays name of parent scope.
* when new TokenLocationFiles are created in the storage they are now returned as shared_ptr to ensure correct linking in the contained data.
* Storage::getTokenLocationsForLinesInFile() now always returns pairs of start and end locations.
* Adjusted code snippet view to regard the change described above.
This commit is contained in:
malte_langkabel
2015-05-11 12:34:27 +02:00
parent 7d48a873f7
commit 97345cc72f
22 changed files with 667 additions and 556 deletions
+3 -3
View File
@@ -90,7 +90,7 @@ void QtCodeView::doShowCodeSnippets(const std::vector<CodeSnippetParams>& snippe
for (const CodeSnippetParams& params : snippets)
{
m_widget->addCodeSnippet(params.startLineNumber, params.code, params.locationFile);
m_widget->addCodeSnippet(params.startLineNumber, params.title, params.code, params.locationFile);
}
}
@@ -102,9 +102,9 @@ void QtCodeView::doShowCodeFile(const CodeSnippetParams& params)
ptr->setShowMaximizeButton(false);
ptr->setActiveTokenIds(m_activeTokenIds);
ptr->setErrorMessages(m_errorMessages);
ptr->addCodeSnippet(1, params.code, params.locationFile);
ptr->addCodeSnippet(1, params.title, params.code, params.locationFile);
ptr->setWindowTitle(params.locationFile.getFilePath().fileName().c_str());
ptr->setWindowTitle(params.locationFile->getFilePath().fileName().c_str());
ptr->show();
float percent = float(params.startLineNumber + params.endLineNumber) / float(params.lineCount) / 2;