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 324de13b4e.

Change-Id: Ied3add2a372b4b176ee800e8c023c3cef5495488
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Eike Ziller
2018-03-08 17:41:14 +01:00
parent 102a058c25
commit 64fe131c14

View File

@@ -270,7 +270,8 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &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--);
}
}