| 438 | } |
| 439 | |
| 440 | std::vector<Executable> ExecutableManager::RemoveMissingExecutables(const std::vector<Executable>& executables) const { |
| 441 | std::vector<Executable> valid_applications; |
| 442 | |
| 443 | // Remove applications that can't be found |
| 444 | for (std::size_t i = 0, n = executables.size(); i < n; ++i) { |
| 445 | const Executable& application = executables[i]; |
| 446 | |
| 447 | const QFileInfo file_info(application.path.AbsolutePath().c_str()); |
| 448 | if (!file_info.exists()) { |
| 449 | continue; |
| 450 | } |
| 451 | |
| 452 | valid_applications.push_back(application); |
| 453 | } |
| 454 | |
| 455 | return valid_applications; |
| 456 | } |