Skip to content

Commit

Permalink
ignore absolute path when loading soundfont. Fix #55416 Fix #21592 Fi…
Browse files Browse the repository at this point in the history
…x #34286
  • Loading branch information
lasconic committed Apr 11, 2015
1 parent 0916878 commit c73eb49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion fluid/fluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,10 @@ bool Fluid::loadSoundFonts(const QStringList& sl)
if (s.isEmpty())
continue;
QString path;
QFileInfo fis(s);
QString fileName = fis.fileName();
foreach (const QFileInfo& fi, l) {
if (fi.fileName() == s) {
if (fi.fileName() == fileName) {
path = fi.absoluteFilePath();
break;
}
Expand Down
8 changes: 5 additions & 3 deletions zerberus/zerberus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,15 @@ bool Zerberus::loadInstrument(const QString& s)
{
if (s.isEmpty())
return false;
QFileInfo fis(s);
QString fileName = fis.fileName();
for (ZInstrument* instr : instruments) {
if (QFileInfo(instr->path()).fileName() == s) { // already loaded?
if (QFileInfo(instr->path()).fileName() == fileName) { // already loaded?
return true;
}
}
for (ZInstrument* instr : globalInstruments) {
if (QFileInfo(instr->path()).fileName() == s) {
if (QFileInfo(instr->path()).fileName() == fileName) {
instruments.push_back(instr);
instr->setRefCount(instr->refCount() + 1);
if (instruments.size() == 1) {
Expand All @@ -422,7 +424,7 @@ bool Zerberus::loadInstrument(const QString& s)
QFileInfoList l = Zerberus::sfzFiles();
QString path;
foreach (const QFileInfo& fi, l) {
if (fi.fileName() == s) {
if (fi.fileName() == fileName) {
path = fi.absoluteFilePath();
break;
}
Expand Down

0 comments on commit c73eb49

Please sign in to comment.