summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/editormanager/documentmodel.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-07-16 13:51:44 +0200
committerEike Ziller <eike.ziller@digia.com>2013-07-16 14:51:27 +0200
commit746e4f41197a37418d03975ee856e28b3c5c13c3 (patch)
tree098dc74a56b36c465d39d9292431edcf86b31848 /src/plugins/coreplugin/editormanager/documentmodel.cpp
parent00a46667d7d7f52d9eb286384823266df8604351 (diff)
downloadqt-creator-746e4f41197a37418d03975ee856e28b3c5c13c3.tar.gz
Fix marking JavaScript lines that threw an exception
Since EditorManager::openedEditors doesn't exactly do what one would expect, it was only marking a single editor even if there were multiple editors on the same document. Change-Id: Iae579c2cfd8455de2783d39fa69944fe92dfc60a Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Diffstat (limited to 'src/plugins/coreplugin/editormanager/documentmodel.cpp')
-rw-r--r--src/plugins/coreplugin/editormanager/documentmodel.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp
index f4191105fd..f4eb1fef3a 100644
--- a/src/plugins/coreplugin/editormanager/documentmodel.cpp
+++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp
@@ -163,7 +163,7 @@ void DocumentModel::addEntry(Entry *entry)
QString fileName = entry->fileName();
// replace a non-loaded entry (aka 'restored') if possible
- int previousIndex = indexofFileName(fileName);
+ int previousIndex = indexOfFilePath(fileName);
if (previousIndex >= 0) {
if (entry->document && d->m_documents.at(previousIndex)->document == 0) {
Entry *previousEntry = d->m_documents.at(previousIndex);
@@ -190,12 +190,12 @@ void DocumentModel::addEntry(Entry *entry)
endInsertRows();
}
-int DocumentModel::indexofFileName(const QString &filename) const
+int DocumentModel::indexOfFilePath(const QString &filePath) const
{
- if (filename.isEmpty())
+ if (filePath.isEmpty())
return -1;
for (int i = 0; i < d->m_documents.count(); ++i) {
- if (d->m_documents.at(i)->fileName() == filename)
+ if (d->m_documents.at(i)->fileName() == filePath)
return i;
}
return -1;
@@ -226,7 +226,7 @@ void DocumentModel::removeEditor(IEditor *editor, bool *lastOneForDocument)
void DocumentModel::removeDocument(const QString &fileName)
{
- int index = indexofFileName(fileName);
+ int index = indexOfFilePath(fileName);
QTC_ASSERT(!d->m_documents.at(index)->document, return); // we wouldn't know what to do with the associated editors
removeDocument(index);
}