Fix crash in include completion with non-canonical include paths

Use QFileInfo::fileName() to get the filename, since that also works
when the original path wasn't canonical.
This commit is contained in:
Thorbjørn Lindeijer
2009-08-20 19:38:43 +02:00
parent d3642a54b2
commit 51d2c831b9
2 changed files with 2 additions and 6 deletions

View File

@@ -1119,11 +1119,7 @@ void CppModelManager::updateIncludesInPaths(QFutureInterface<void> &future,
const QFileInfo fileInfo = i.fileInfo();
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;
}
QString text = fileInfo.fileName();
if (fileInfo.isDir()) {
text += QLatin1Char('/');

View File

@@ -41,7 +41,7 @@ namespace ProjectExplorer {
}
namespace CppTools {
class AbstractEditorSupport;
class CPPTOOLS_EXPORT CppModelManagerInterface : public QObject