From 83ea1f4deb4f5752f4eb1e36664761a7cdc79a9e Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 16 Aug 2016 13:37:49 +0200 Subject: CppTools: Add UI for file size limit of indexer Task-number: QTCREATORBUG-16712 Change-Id: I92db8cbcac9669cbd5e4ee5f7ef6f613797c753a Reviewed-by: David Schulz Reviewed-by: Orgad Shaneh --- src/plugins/cpptools/cppsourceprocessor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp') diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp index e04d977ebf..89da0a02ad 100644 --- a/src/plugins/cpptools/cppsourceprocessor.cpp +++ b/src/plugins/cpptools/cppsourceprocessor.cpp @@ -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; -- cgit v1.2.1