ext Dale Marchand wrote:
Hi,

I'm using the current git master version (5b6ab144c6cabd8d01a5974fe66a0a5be72050a7) and am getting a crash whenever I try to add the first double quotes of an #include directive

i.e. #include "

That's pretty bad. Unfortunately, it's not immediately obvious to us how this problem can happen. It seems like there is at least one item at the start of the returned list of completions that has no text.

Since this shouldn't be the case, we inserted a warning with the attached patch that could hopefully give some more information about what is causing this problem.

The attached patch will also be in the next nightly snapshot, please try if this fixes the crash, and if so, I'd be very interested in the warning that is printed out.

Regards,
Bjørn

--
Thorbjørn Lindeijer
Software Engineer
Nokia, Qt Development Frameworks
>From 5b6ccb0468589bbecae2e980e5172a3e5b6bb253 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Thorbj=C3=B8rn=20Lindeijer?= <[email protected]>
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 <[email protected]>
---
 src/plugins/cpptools/cppmodelmanager.cpp |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index c16f986..2c7d0f8 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -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('/');
 
-- 
1.6.3.9.g6345d

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to