From c9596d2de5cd91468738c32b2f61ed51c4d245db Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 20 May 2011 22:59:12 +0000 Subject: Run session load script from within session directory (for relative paths). git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3303 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index edb5f53..576b32c 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -566,12 +566,15 @@ Patchage::show_open_session_dialog() } const std::string dir = dialog.get_filename(); - const std::string cmd = dir + "/jack-session"; + if (g_chdir(dir.c_str())) { + Raul::error << "Failed to switch to session directory " << dir << endl; + return; + } - if (system(cmd.c_str()) < 0) { - Raul::error << "Error executing session load command " << cmd << endl; + if (system("./jack-session") < 0) { + Raul::error << "Error executing `./jack-session' in " << dir << endl; } else { - Raul::info << "Executed session load command " << cmd << endl; + Raul::info << "Loaded session " << dir << endl; } } -- cgit v1.2.1