| 423 | } |
| 424 | |
| 425 | void WelcomeWindow::ParseRecentFile() |
| 426 | { |
| 427 | if (!FileSystem::FileExists(_RecentProjectFilePath, true)) |
| 428 | { |
| 429 | FileSystem::BeginWriteFile(_RecentProjectFilePath, true); |
| 430 | FileSystem::WriteLine(_RecentProjectFileDefaultContent); |
| 431 | FileSystem::EndWriteFile(); |
| 432 | } |
| 433 | |
| 434 | std::string content = Nuake::FileSystem::ReadFile(_RecentProjectFilePath); |
| 435 | if (content != "") |
| 436 | { |
| 437 | nlohmann::json j = nlohmann::json::parse(content); |
| 438 | for (auto& project : j["Projects"]) |
| 439 | { |
| 440 | auto projectPreview = ProjectPreview(); |
| 441 | projectPreview.Deserialize(project); |
| 442 | _Projects.push_back(projectPreview); |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | void WelcomeWindow::SaveRecentFile() |
| 448 | { |
nothing calls this directly
no test coverage detected