GUI: Cleanup non-existing projects from the MRU

This commit is contained in:
Daniel Marjamäki 2018-08-08 11:03:51 +02:00
parent f68f793256
commit ddf7b186bb
1 changed files with 2 additions and 3 deletions

View File

@ -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++;
}