CppTools: Add UI for file size limit of indexer

Task-number: QTCREATORBUG-16712
Change-Id: I92db8cbcac9669cbd5e4ee5f7ef6f613797c753a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Nikolai Kosjar
2016-08-16 13:37:49 +02:00
parent 6c00095181
commit 83ea1f4deb
12 changed files with 155 additions and 23 deletions

View File

@@ -448,7 +448,7 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
}
const QFileInfo info(absoluteFileName);
if (skipFileDueToSizeLimit(info))
if (fileSizeExceedsLimit(info, m_fileSizeLimitInMb))
return; // TODO: Add diagnostic message
// Otherwise get file contents
@@ -505,6 +505,11 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
switchCurrentDocument(previousDocument);
}
void CppSourceProcessor::setFileSizeLimitInMb(int fileSizeLimitInMb)
{
m_fileSizeLimitInMb = fileSizeLimitInMb;
}
Document::Ptr CppSourceProcessor::switchCurrentDocument(Document::Ptr doc)
{
const Document::Ptr previousDoc = m_currentDoc;