aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-02-23 07:29:07 -0800
committerChris Robinson <[email protected]>2016-02-23 07:29:07 -0800
commitdea880dbf451e1b0ae1cdbff8643d3eb9208f536 (patch)
tree9149da131e805aa735aab43f1bcb73ff84115e4f /utils
parentae1a2fa9c0948ce5dee197a11816992b8b64f7d3 (diff)
Better handle duplicate HRTF names in alsoft-config
Diffstat (limited to 'utils')
-rw-r--r--utils/alsoft-config/mainwindow.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 315ef491..17407498 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -357,7 +357,23 @@ QStringList MainWindow::collectDefaultHrtfs()
foreach(const QString &fname, fnames)
{
if(fname.endsWith(".mhr", Qt::CaseInsensitive))
- ret.push_back(fname);
+ {
+ if(!ret.contains(fname))
+ ret.push_back(fname);
+ else
+ {
+ size_t i = 1;
+ do {
+ QString s = fname+" #"+QString::number(i);
+ if(!ret.contains(s))
+ {
+ ret.push_back(s);
+ break;
+ }
+ ++i;
+ } while(1);
+ }
+ }
}
}
return ret;