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>
This commit is contained in:
Thorbjørn Lindeijer
2009-08-20 17:38:22 +02:00
parent beb2916ea6
commit 5b6ccb0468

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('/');