From cb42d2cc4daa09c7d1db5515e39e94b9a5a43447 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Dec 2008 05:49:41 +0000 Subject: Rewrite pretty much everything to do with paths in Serialiser to actually make an ounce of sense. Fix various things with nested patches (fix tickets #286 #289). Cascade successive pastes nicely. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1840 a436a847-0d15-0410-975c-d299462d15a1 --- src/ingen/main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/ingen/main.cpp') diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 51e98079..1861f212 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -242,9 +242,18 @@ main(int argc, char** argv) /* Load a patch */ if (args.load_given && engine_interface) { - Glib::ustring engine_base = "/"; - if (args.path_given) - engine_base = string(args.path_arg) + "/"; + boost::optional data_path; + boost::optional parent; + boost::optional symbol; + + const Glib::ustring path = (args.path_given ? args.path_arg : "/"); + if (Path::is_valid(path)) { + const Path p(path); + parent = p.parent(); + symbol = p.name(); + } else { + cerr << "Invalid path: '" << path << endl; + } bool found = false; if (!world->serialisation_module) @@ -269,7 +278,7 @@ main(int argc, char** argv) } engine_interface->load_plugins(); - parser->parse_document(world, engine_interface.get(), uri, engine_base, uri); + parser->parse_document(world, engine_interface.get(), uri, data_path, parent, symbol); } else { cerr << "Unable to load serialisation module, aborting." << endl; -- cgit v1.2.1