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

@@ -611,9 +611,9 @@ QByteArray CppModelManager::codeModelConfiguration() const
return QByteArray::fromRawData(pp_configuration, qstrlen(pp_configuration));
}
static QSet<QString> tooBigFilesRemoved(const QSet<QString> &files, int fileSizeLimit)
static QSet<QString> tooBigFilesRemoved(const QSet<QString> &files, int fileSizeLimitInMb)
{
if (fileSizeLimit == 0)
if (fileSizeLimitInMb <= 0)
return files;
QSet<QString> result;
@@ -623,7 +623,7 @@ static QSet<QString> tooBigFilesRemoved(const QSet<QString> &files, int fileSize
while (i.hasNext()) {
const QString filePath = i.next();
fileInfo.setFile(filePath);
if (skipFileDueToSizeLimit(fileInfo, fileSizeLimit))
if (fileSizeExceedsLimit(fileInfo, fileSizeLimitInMb))
continue;
result << filePath;
@@ -638,7 +638,7 @@ QFuture<void> CppModelManager::updateSourceFiles(const QSet<QString> &sourceFile
if (sourceFiles.isEmpty() || !d->m_indexerEnabled)
return QFuture<void>();
const auto filteredFiles = tooBigFilesRemoved(sourceFiles, fileSizeLimit());
const QSet<QString> filteredFiles = tooBigFilesRemoved(sourceFiles, indexerFileSizeLimitInMb());
if (d->m_indexingSupporter)
d->m_indexingSupporter->refreshSourceFiles(filteredFiles, mode);