GUI: Cleanup non-existing projects from the MRU
This commit is contained in:
parent
f68f793256
commit
ddf7b186bb
|
@ -1685,11 +1685,10 @@ void MainWindow::updateMRUMenuItems()
|
||||||
|
|
||||||
QStringList projects = mSettings->value(SETTINGS_MRU_PROJECTS).toStringList();
|
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();
|
int removed = projects.removeDuplicates();
|
||||||
for (int i = projects.size() - 1; i >= 0; i--) {
|
for (int i = projects.size() - 1; i >= 0; i--) {
|
||||||
QString text = projects[i].trimmed();
|
if (!QFileInfo(projects[i]).exists()) {
|
||||||
if (text.isEmpty()) {
|
|
||||||
projects.removeAt(i);
|
projects.removeAt(i);
|
||||||
removed++;
|
removed++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue