21 const int max_recent_projects = 10;
23 const QString group_key =
"welcomeview";
24 const QString current_workdir_key =
"currentworkdir";
25 const QString recent_projects_key =
"recentprojects";
27 const QString workdir_setting_name()
29 return group_key +
"/" + current_workdir_key;
32 const QString recent_projects_setting_name()
34 return group_key +
"/" + recent_projects_key;
61 if (!dirname.isEmpty()) {
70 QStringList updatedList;
73 updatedList.append(fileName);
107 if (settings.contains(workdir_setting_name()))
110 if (settings.contains(recent_projects_setting_name()))
111 m_recentProjects = settings.value(recent_projects_setting_name()).toStringList();
QStringList recentProjects()
Returns list of recent projects, validates if projects still exists on disk.
void updateWorkdirFromSelection(const QString &dirname)
Updates current workdir value from user selection.
QString currentWorkdir() const
Returns current workdir.
void clearRecentProjectsList()
void addToRecentProjects(const QString &dirname)
Adds directory to the list of recent projects.
void readSettings()
Reads all settings from file.
QStringList m_recentProjects
void writeSettings()
Write all settings to file.
MVVM_MODEL_EXPORT std::string parent_path(const std::string &path)
Returns the path to the parent directory.
MVVM_MODEL_EXPORT bool exists(const std::string &fileName)
Returns true if file exists.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.