ui: recent projects menu fix

recent projects updates now when a projects is loaded
This commit is contained in:
Andreas Stallinger
2015-11-17 12:13:48 +01:00
parent 42afbce300
commit 86f06c9f78
8 changed files with 47 additions and 27 deletions
+2
View File
@@ -87,6 +87,8 @@ void Application::loadProject(const FilePath& projectSettingsFilePath)
m_project = Project::create(m_storageCache.get());
m_project->loadProjectSettings(projectSettingsFilePath);
m_project->loadStorage();
m_mainView->updateRecentProjectMenu();
}
void Application::refreshProject()
+1
View File
@@ -15,6 +15,7 @@ public:
virtual void hideStartScreen() = 0;
virtual void setTitle(const std::string& title) = 0;
virtual void activateWindow() = 0;
virtual void updateRecentProjectMenu() = 0;
};
#endif // MAIN_VIEW_H
+10 -1
View File
@@ -113,7 +113,16 @@ ApplicationSettings::ApplicationSettings()
std::vector<FilePath> ApplicationSettings::getRecentProjects() const
{
return getPathValues("user/recent_projects/recent_project");
std::vector<FilePath> recentProjects = getPathValues("user/recent_projects/recent_project");
std::vector<FilePath>::iterator iter = recentProjects.end();
for( ; iter != recentProjects.begin(); iter--)
{
if(!(*iter).exists())
{
recentProjects.erase(iter);
}
}
return recentProjects;
}
bool ApplicationSettings::setRecentProjects(const std::vector<FilePath> &recentProjects)