| 7456 | } |
| 7457 | |
| 7458 | bool CEditor::Save(const char *pFilename) |
| 7459 | { |
| 7460 | // Check if file with this name is already being saved at the moment |
| 7461 | if(std::any_of(std::begin(m_WriterFinishJobs), std::end(m_WriterFinishJobs), [pFilename](const std::shared_ptr<CDataFileWriterFinishJob> &Job) { |
| 7462 | return str_comp(pFilename, Job->RealFilename()) == 0; |
| 7463 | })) |
| 7464 | { |
| 7465 | return false; |
| 7466 | } |
| 7467 | |
| 7468 | const auto &&ErrorHandler = [this](const char *pErrorMessage) { |
| 7469 | ShowFileDialogError("%s", pErrorMessage); |
| 7470 | log_error("editor/save", "%s", pErrorMessage); |
| 7471 | }; |
| 7472 | return Map()->Save(pFilename, ErrorHandler); |
| 7473 | } |
| 7474 | |
| 7475 | bool CEditor::HandleMapDrop(const char *pFilename, int StorageType) |
| 7476 | { |
no test coverage detected