Added a check for empty filename

No empty entries should be added to the completion list, but it seems
like this is what is happening. Maybe this warning will give some more
information about the problem.

Reviewed-by: Daniel Molkentin <daniel.molkentin@nokia.com>
(cherry picked from commit 5b6ccb0468)
This commit is contained in:
Thorbjørn Lindeijer
2009-08-20 17:38:22 +02:00
committed by con
parent 138ed2fbde
commit 904a6ec623

View File

@@ -1120,6 +1120,10 @@ void CppModelManager::updateIncludesInPaths(QFutureInterface<void> &future,
const QString suffix = fileInfo.suffix();
if (suffix.isEmpty() || suffixes.contains(suffix)) {
QString text = fileName.mid(path.length() + 1);
if (text.isEmpty()) {
qWarning() << Q_FUNC_INFO << "Empty filename?" << path << fileName;
continue;
}
if (fileInfo.isDir()) {
text += QLatin1Char('/');