Skip to content
Permalink
Browse files

Merge pull request #3000: Discard duplicate path exceptions

  • Loading branch information...
Kissaki committed Apr 6, 2017
2 parents e7e6197 + 79dd6b9 commit c1e9102cb24aebee1e676848ca769ca1368a269c
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/mumble/OverlayConfig.cpp
@@ -790,10 +790,14 @@ void OverlayConfig::on_qpbPathsAdd_clicked() {
QString existingPath = QFileDialog::getExistingDirectory(this, tr("Choose path"));
QString dir = QDir::toNativeSeparators(existingPath);

if (! dir.isEmpty()) {
QListWidgetItem *qlwiPath = new QListWidgetItem(QIcon(), dir, qlwPaths);
QListWidget *sel = qlwPaths;
QStringList qslIdentifiers;
for (int i = 0; i < sel->count(); i++)
qslIdentifiers << sel->item(i)->data(Qt::UserRole).toString();
if (! dir.isEmpty() && ! qslIdentifiers.contains(dir)) {
QListWidgetItem *qlwiPath = new QListWidgetItem(QIcon(), dir, sel);
qlwiPath->setData(Qt::UserRole, QVariant(dir));
qlwPaths->setCurrentItem(qlwiPath);
sel->setCurrentItem(qlwiPath);
}
}

0 comments on commit c1e9102

Please sign in to comment.
You can’t perform that action at this time.