summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-05-12 14:20:32 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-05-13 08:26:52 +0000
commit1960503ae994d14d79bad6507f2ed692e5c2230d (patch)
treedbfeba4388f70ef6dfd4a382ac1d4018bf4e66c2 /src/plugins/cpptools/cppsourceprocessor.cpp
parentf52170737eb00c825e6e2354b9d99d2c342aa740 (diff)
downloadqt-creator-1960503ae994d14d79bad6507f2ed692e5c2230d.tar.gz
CppTools: Allow to limit the files to process by file size
...with the environment variable QTC_CPP_FILE_SIZE_LIMIT_MB. Task-number: QTCREATORBUG-14390 Change-Id: Iaefaa1a3db023b58f9351b96e1b9e2139797e280 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r--src/plugins/cpptools/cppsourceprocessor.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp
index 4f292c0a34..036435d692 100644
--- a/src/plugins/cpptools/cppsourceprocessor.cpp
+++ b/src/plugins/cpptools/cppsourceprocessor.cpp
@@ -31,6 +31,7 @@
#include "cppsourceprocessor.h"
#include "cppmodelmanager.h"
+#include "cpptoolsreuse.h"
#include <coreplugin/editormanager/editormanager.h>
@@ -454,6 +455,10 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
return;
}
+ const QFileInfo info(absoluteFileName);
+ if (skipFileDueToSizeLimit(info))
+ return; // TODO: Add diagnostic message
+
// Otherwise get file contents
unsigned editorRevision = 0;
QByteArray contents;
@@ -473,7 +478,6 @@ void CppSourceProcessor::sourceNeeded(unsigned line, const QString &fileName, In
Document::Include inc(include, include, 0, IncludeLocal);
document->addIncludeFile(inc);
}
- const QFileInfo info(absoluteFileName);
if (info.exists())
document->setLastModified(info.lastModified());