From 89c1a88dc87497470f5b5877b6abcc58d7a56117 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Thu, 29 Jul 2010 07:38:01 +0000 Subject: Theme Editor: Recent documents/projects that no longer exist are now cleared from the menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27611 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/gui/editorwindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor/gui/editorwindow.cpp') diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index f76fd8e88b..6bc40fbff6 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp @@ -110,7 +110,7 @@ void EditorWindow::loadConfigTab(ConfigDocument* doc) this, SLOT(tabTitleChanged(QString))); } -void EditorWindow::loadSettings() +void EditorWindow::loadSettings() { QSettings settings; @@ -918,6 +918,16 @@ void EditorWindow::projectToTop(QString file) void EditorWindow::refreshRecentMenus() { + /* Clearing any deleted documents */ + for(int i = 0; i < recentDocs.count(); i++) + if(!QFile::exists(recentDocs[i])) + recentDocs.removeAt(i--); + + /* Clearing any deleted projects */ + for(int i = 0; i < recentProjects.count(); i++) + if(!QFile::exists(recentProjects[i])) + recentProjects.removeAt(i--); + /* First hiding all the menu items */ for(int i = 0; i < recentDocsMenu.count(); i++) recentDocsMenu[i]->setVisible(false); -- cgit v1.2.3