diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-16 00:14:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-11-16 00:14:06 +0000 |
commit | 71f69453ede12c54dfaa579d989735981573594d (patch) | |
tree | c3d0f461fa323a148152301494721ff06aaa0085 /libs/ardour/panner_manager.cc | |
parent | 535f52c1b53f236257bf7a2d464fe90d0f348c43 (diff) |
avoid duplicate panners by checking names, not symlinks
git-svn-id: svn://localhost/ardour2/branches/3.0@10636 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/panner_manager.cc')
-rw-r--r-- | libs/ardour/panner_manager.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libs/ardour/panner_manager.cc b/libs/ardour/panner_manager.cc index 7203f57cba..6230b6b429 100644 --- a/libs/ardour/panner_manager.cc +++ b/libs/ardour/panner_manager.cc @@ -20,11 +20,11 @@ #include <unistd.h> #include <glibmm/pattern.h> +#include <glibmm/fileutils.h> #include "pbd/error.h" #include "pbd/compose.h" #include "pbd/file_utils.h" -#include "pbd/symlink.h" #include "ardour/panner_manager.h" #include "ardour/panner_search_path.h" @@ -87,17 +87,20 @@ PannerManager::panner_discover (string path) { PannerInfo* pinfo; - /* don't look in symlinks, because otherwise we find too many versions - * of the same library. - */ + if ((pinfo = get_descriptor (path)) != 0) { - if (PBD::is_symlink (path)) { - return 0; - } + list<PannerInfo*>::iterator i; - if ((pinfo = get_descriptor (path)) != 0) { - panner_info.push_back (pinfo); - info << string_compose(_("Panner discovered: \"%1\" in %2"), pinfo->descriptor.name, path) << endmsg; + for (i = panner_info.begin(); i != panner_info.end(); ++i) { + if (pinfo->descriptor.name == (*i)->descriptor.name) { + break; + } + } + + if (i == panner_info.end()) { + panner_info.push_back (pinfo); + info << string_compose(_("Panner discovered: \"%1\" in %2"), pinfo->descriptor.name, path) << endmsg; + } } return 0; |