Skip to content

Commit

Permalink
Update loadcanvas.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
eshikafe committed Oct 15, 2024
1 parent 7cc6e4f commit 6f20fa6
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions synfig-core/src/loadcanvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,35 @@ pub fn open_canvas(node: &xmlpp::Element, errors: String, warnings: String) -> B

// Loads a canvas from a filename and its absolute path
// returns the Canvas's handle on success, an None on failure
// pub fn open_canvas_as(
// identifier: filesystem::Identifier,
// as_: String,
// errors: String,
// warnings: String,
// ) -> Option<Box<Canvas>> {
// let filename = filesystem::fix_slashes(as_);

// //if CanvasParser::loading.contains(&identifier)
// if identifier.filename.is_empty()
// {
// let warning = format!("cannot load '{}' recursively", identifier.filename.as_str());
// warn!("{}", warning);
// let warnings = format!(" * {}\n", warning);
// let mut canvas = Canvas::create();
// canvas.set_identifier(identifier);
// canvas.set_file_name(filename);
// // Layer::Handle paste(Layer_Group::create());
// // canvas->push_back(paste);
// // paste->set_description(warning);
// return Some(canvas);
// }

// let mut canvas: Box<Canvas>;
// //let mut parser = CanvasParser::new();

// // Some(canvas)
// None
// }
pub fn open_canvas_as(
identifier: filesystem::Identifier,
as_: String,
errors: String,
warnings: String,
) -> Option<Box<Canvas>> {
let filename = filesystem::fix_slashes(as_);

//if CanvasParser::loading.contains(&identifier)
if identifier.filename.is_empty()
{
let warning = format!("cannot load '{}' recursively", identifier.filename.as_str());
warn!("{}", warning);
let warnings = format!(" * {}\n", warning);
let mut canvas = Canvas::create();
canvas.set_identifier(identifier);
canvas.set_file_name(filename);
// Layer::Handle paste(Layer_Group::create());
// canvas->push_back(paste);
// paste->set_description(warning);
return Some(canvas);
}

let mut canvas: Box<Canvas>;
//let mut parser = CanvasParser::new();

// Some(canvas)
None
}

// Returns the Open Canvases Map.
type OpenCanvasMap = HashMap<i32, String>;
Expand Down

0 comments on commit 6f20fa6

Please sign in to comment.