summaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 76e81bf..66c0ac4 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -22,6 +22,7 @@
#include <config.h>
#endif
+#include <QDebug>
#include <set>
#include "mainwindow.h"
@@ -258,9 +259,23 @@ void MainWindow::updateCard(const pa_card_info &info) {
if (!p_profile->available)
desc += tr(" (unavailable)").toUtf8().constData();
- w->profiles.push_back(std::pair<QByteArray,QByteArray>(p_profile->name, desc));
- if (p_profile->n_sinks == 0 && p_profile->n_sources == 0)
- w->noInOutProfile = p_profile->name;
+ QString parseId = QString::fromUtf8(p_profile->name);
+ int plus = parseId.indexOf(QLatin1Char('+'));
+ if (plus != -1) {
+ parseId = parseId.left(plus);
+ }
+ auto list = parseId.split(QRegularExpression(QLatin1String("[:\\-]")));
+ parseId.clear();
+ for (auto p : list) {
+ if (p == QLatin1String("input") || p == QLatin1String("output"))
+ continue;
+ if (parseId.isEmpty() || p.startsWith(QLatin1String("extra"))) {
+ parseId.append(p);
+ }
+ }
+ qDebug() << "ParseID:" << parseId;
+ ProfileGroup &group = w->profiles[parseId];
+ group.addEntry(p_profile->name, desc.constData());
}
w->activeProfile = info.active_profile ? info.active_profile->name : "";