From ddf7b186bb6564a02a9169111160cf888860f572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 8 Aug 2018 11:03:51 +0200 Subject: [PATCH] GUI: Cleanup non-existing projects from the MRU --- gui/mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 998578ebb..537a0a8f7 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1685,11 +1685,10 @@ void MainWindow::updateMRUMenuItems() QStringList projects = mSettings->value(SETTINGS_MRU_PROJECTS).toStringList(); - // Do a sanity check - remove duplicates and empty or space only items + // Do a sanity check - remove duplicates and non-existing projects int removed = projects.removeDuplicates(); for (int i = projects.size() - 1; i >= 0; i--) { - QString text = projects[i].trimmed(); - if (text.isEmpty()) { + if (!QFileInfo(projects[i]).exists()) { projects.removeAt(i); removed++; }