Move project save target planning to app core

This commit is contained in:
2026-06-06 11:52:49 +02:00
parent 9d9b93abb1
commit ed9709ade8
8 changed files with 217 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
#include "app.h"
#include "legacy_gl_renderbuffer_dispatch.h"
#include "legacy_ui_gl_dispatch.h"
#include "app_core/document_canvas.h"
#include "texture.h"
#include "node_progress_bar.h"
#include "paint_renderer/compositor.h"
@@ -2371,10 +2372,15 @@ bool Canvas::project_save_thread(std::string file_path, bool show_progress)
// sprintf(name, "%s/latlong.ppi", data_path.c_str());
FILE* fp;
auto start = file_path.rfind('/') + 1;
std::string file_name = file_path.substr(start, file_path.length() - start - strlen(".ppi"));
std::string tmp_path = App::I->data_path + '/' + file_name + ".tmp.ppi";
std::string lapse_path = App::I->data_path + '/' + file_name + ".pptl";
const auto save_target = pp::app::plan_document_canvas_project_save_target(App::I->data_path, file_path);
if (!save_target) {
LOG("cannot plan project save target for %s: %s", file_path.c_str(), save_target.status().message);
return false;
}
const auto& save_paths = save_target.value();
const std::string& file_name = save_paths.file_name;
const std::string& tmp_path = save_paths.temporary_path;
const std::string& lapse_path = save_paths.timelapse_path;
LOG("file name %s", file_name.c_str());
LOG("tmp path %s", tmp_path.c_str());