From 904a6ec623112d25ea987dc914479e7d5a32203d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Thu, 20 Aug 2009 17:38:22 +0200 Subject: [PATCH] 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 (cherry picked from commit 5b6ccb0468589bbecae2e980e5172a3e5b6bb253) --- src/plugins/cpptools/cppmodelmanager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index c16f986180c..2c7d0f8f5a6 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -1120,6 +1120,10 @@ void CppModelManager::updateIncludesInPaths(QFutureInterface &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('/');