diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-08-16 13:37:49 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-08-31 07:47:27 +0000 |
commit | 83ea1f4deb4f5752f4eb1e36664761a7cdc79a9e (patch) | |
tree | 4b95a5d93201e259063d03ab31258b561e8746fd /src/plugins/cpptools/cppsourceprocessor.cpp | |
parent | 6c00095181d8ef1dd1ff2d6090e8668376641e1b (diff) | |
download | qt-creator-83ea1f4deb4f5752f4eb1e36664761a7cdc79a9e.tar.gz |
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>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r-- | src/plugins/cpptools/cppsourceprocessor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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; |