diff options
author | David Robillard <d@drobilla.net> | 2011-05-20 22:59:12 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-20 22:59:12 +0000 |
commit | c9596d2de5cd91468738c32b2f61ed51c4d245db (patch) | |
tree | ca88b25541d7dffb25925b5171c5945b11e16ca1 /src | |
parent | 5499935ae017305a4b08ef7d0c1dc80739bb5aad (diff) | |
download | patchage-c9596d2de5cd91468738c32b2f61ed51c4d245db.tar.gz patchage-c9596d2de5cd91468738c32b2f61ed51c4d245db.tar.bz2 patchage-c9596d2de5cd91468738c32b2f61ed51c4d245db.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Patchage.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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; } } |