Skip to content

Commit

Permalink
multifile storage, option of static embedded file path, fix insert in…
Browse files Browse the repository at this point in the history
… new node that was never saved (#2354)
  • Loading branch information
giuspen committed Feb 2, 2025
1 parent f2d6e3d commit 47c9e8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ct/ct_actions_edit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ void CtActions::embfile_insert_path(const std::string& filepath)
if (embfileMFNameOnDisk) {
embfilePath = _pCtMainWin->get_ct_storage()->get_embedded_filepath(_pCtMainWin->curr_tree_iter(), name);
if (not fs::exists(embfilePath)) {
const fs::path embfileDir = embfilePath.parent_path();
if (not fs::is_directory(embfileDir)) {
g_mkdir_with_parents(embfileDir.c_str(), 0777);
}
const bool copyRes = fs::copy_file(filepath, embfilePath);
spdlog::debug("{} {} {} -> {}", __FUNCTION__, copyRes ? "OK":"!!", filepath.c_str(), embfilePath.c_str());
}
Expand Down

0 comments on commit 47c9e8a

Please sign in to comment.