45 {
47 const auto now = std::chrono::system_clock::now();
48
50
51 auto projects = cloudProjectsDatabase.GetCloudProjects();
52
53 for (
const auto&
project : projects)
54 {
56 return;
57
59
60 if (!wxFileExists(path))
61 {
62 cloudProjectsDatabase.DeleteProject(
project.ProjectId);
63 continue;
64 }
65
66 const auto lastAccess =
68
69 const auto discardTreshold =
70 std::chrono::system_clock::from_time_t(lastAccess) + timeToKeep;
71
72 if (discardTreshold > now)
73 continue;
74
75 if (wxRemoveFile(path))
76 cloudProjectsDatabase.DeleteProject(
project.ProjectId);
77 }
78
79
80 }
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined */
IntSetting DaysToKeepFiles
wxString ToWXString(const std::string &str)