From 64fe131c142377821a1e38671e5684946616a33f Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 8 Mar 2018 17:41:14 +0100 Subject: [PATCH] Fix ordering of items without file name in open documents popup An item that has no file name (like Git Commit, Diff etc.) was always last in the list. Broke by 324de13b4e6703db778010d0682ac26cff359516. Change-Id: Ied3add2a372b4b176ee800e8c023c3cef5495488 Reviewed-by: Orgad Shaneh --- src/plugins/coreplugin/editormanager/editorview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 4d6dc676232..9848b30ab1d 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -270,7 +270,8 @@ void EditorView::updateEditorHistory(IEditor *editor, QList &histo for (int i = 0; i < history.size(); ++i) { const EditLocation &item = history.at(i); if (item.document == document - || !DocumentModel::indexOfFilePath(FileName::fromString(item.fileName))) { + || (!item.document + && !DocumentModel::indexOfFilePath(FileName::fromString(item.fileName)))) { history.removeAt(i--); } }