diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-14 21:54:04 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-14 21:54:04 +0000 |
commit | 8cfd91ac46943eff930b6c24dbeba3560aad94b0 (patch) | |
tree | 10cb4268a28c8f7ab110e06c8b1fba305822b229 /libs | |
parent | 7bdda0e44cfe134f754518d3b61d2492b741164e (diff) |
do not add 2.X search path if its already present in the search path
git-svn-id: svn://localhost/ardour2/branches/3.0@13503 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 440ba026ae..83074fae1f 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4385,7 +4385,7 @@ Session::source_search_path (DataType type) const if (session_dirs.size() == 1) { switch (type) { case DataType::AUDIO: - s.push_back ( _session_dir->sound_path()); + s.push_back (_session_dir->sound_path()); break; case DataType::MIDI: s.push_back (_session_dir->midi_path()); @@ -4408,7 +4408,9 @@ Session::source_search_path (DataType type) const if (type == DataType::AUDIO) { const string sound_path_2X = _session_dir->sound_path_2X(); if (Glib::file_test (sound_path_2X, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) { - s.push_back (sound_path_2X); + if (find (s.begin(), s.end(), sound_path_2X) == s.end()) { + s.push_back (sound_path_2X); + } } } @@ -4427,16 +4429,7 @@ Session::source_search_path (DataType type) const } for (vector<string>::iterator i = dirs.begin(); i != dirs.end(); ++i) { - - vector<string>::iterator si; - - for (si = s.begin(); si != s.end(); ++si) { - if ((*si) == *i) { - break; - } - } - - if (si == s.end()) { + if (find (s.begin(), s.end(), *i) == s.end()) { s.push_back (*i); } } |