diff options
author | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-11-14 10:35:54 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2013-11-14 11:21:26 +0100 |
commit | d8077db3fbebb8701b10f0d37f1b228d4f708cbe (patch) | |
tree | fed81112d5724f2d4f982f44757203fda3205e63 /src/plugins/cpptools/cpptoolseditorsupport.cpp | |
parent | d8d71b413974464f7cad4c4b1621c48e485f0fd3 (diff) | |
download | qt-creator-d8077db3fbebb8701b10f0d37f1b228d4f708cbe.tar.gz |
CppTools: Fix crash for documents without file paths
Since commit 566be09 we might reparse the current document if the
current editor changes. This is fine as long as the current document has
a file path, which is not always true, especially for the documents
created in the FakeVim tests.
Task-number: QTCREATORBUG-10767
Change-Id: Ibe00ef8bb6a144e2ba09b311025d238c2dcde112
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/cpptools/cpptoolseditorsupport.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolseditorsupport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index c720b3b73a..ed039bf900 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -286,7 +286,7 @@ static void parse(QFutureInterface<void> &future, CppEditorSupport *support) QSharedPointer<SnapshotUpdater> updater = support->snapshotUpdater(); updater->update(cmm->workingCopy()); - cmm->finishedRefreshingSourceFiles(QStringList(updater->document()->fileName())); + cmm->finishedRefreshingSourceFiles(QStringList(updater->fileInEditor())); future.setProgressValue(1); } @@ -298,7 +298,7 @@ void CppEditorSupport::updateDocumentNow() } else { m_updateDocumentTimer->stop(); - if (m_fileIsBeingReloaded) + if (m_fileIsBeingReloaded || fileName().isEmpty()) return; if (m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo()) |