mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-28 09:27:39 +01:00
commit so i can do this on OS X with a reasonable link time
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2899 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
d8457cdddf
commit
4daa640d22
2 changed files with 17 additions and 16 deletions
|
|
@ -2068,6 +2068,7 @@ ARDOUR_UI::get_session_parameters (Glib::ustring predetermined_path, bool have_e
|
|||
session_name = basename_nosuffix (string (predetermined_path));
|
||||
|
||||
new_session_dialog->set_session_name (session_name);
|
||||
cerr << "set sF to " << session_path << endl;
|
||||
new_session_dialog->set_session_folder (session_path);
|
||||
new_session_dialog->set_modal (true);
|
||||
|
||||
|
|
|
|||
|
|
@ -539,26 +539,26 @@ NewSessionDialog::set_session_name (const Glib::ustring& name)
|
|||
void
|
||||
NewSessionDialog::set_session_folder(const Glib::ustring& dir)
|
||||
{
|
||||
Glib::ustring realdir = dir;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
/* GtkFileChooser doesn't accept non-absolute pathnames without vomiting */
|
||||
char *res = realpath (dir.c_str(), buf);
|
||||
|
||||
if (!Glib::path_is_absolute (realdir)) {
|
||||
if (realdir.length() == 1 && realdir[0] == '.') {
|
||||
realdir.replace (0, 1, Glib::get_current_dir());
|
||||
} else if (realdir.length() > 1 && realdir[0] == '.' && realdir[1] == '/') {
|
||||
realdir.replace (0, 1, Glib::get_current_dir());
|
||||
} else if (realdir.length() == 2 && realdir[0] == '.' && realdir[1] == '.') {
|
||||
realdir.replace (0, 2, Glib::path_get_dirname (Glib::get_current_dir()));
|
||||
} else if (realdir.length() > 2 && realdir[0] == '.' && realdir[1] == '.' && realdir[2] == '/') {
|
||||
realdir.replace (0, 2, Glib::path_get_dirname (Glib::get_current_dir()));
|
||||
} else {
|
||||
error << string_compose (_("Non-absolute path \"%1\" not usable - ignored"), realdir) << endmsg;
|
||||
return;
|
||||
if (res) {
|
||||
|
||||
cerr << "canonical = " << res << endl;
|
||||
|
||||
Glib::ustring realdir = res;
|
||||
free (res);
|
||||
|
||||
if (!Glib::file_test (realdir, Glib::FILE_TEST_IS_DIR)) {
|
||||
realdir = Glib::path_get_dirname (realdir);
|
||||
cerr << "no such dir, use " << realdir << endl;
|
||||
}
|
||||
}
|
||||
|
||||
m_folder->set_current_folder (realdir);
|
||||
m_folder->set_current_folder (realdir);
|
||||
} else {
|
||||
cerr << dir << " not resolvable\n";
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue