ignore absolute path when loading soundfont. Fix #55416 Fix #21592 Fix #34286

This commit is contained in:
lasconic 2015-04-11 17:34:22 +02:00
parent 09168784ee
commit c73eb49581
2 changed files with 8 additions and 4 deletions

View file

@ -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;
}

View file

@ -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) {
@ -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;
}