Commit ed76e11a authored by James D. Smith's avatar James D. Smith

[Baloo KCM] Prevent duplicate paths in the config file.

parent 9c5d8bfd
......@@ -121,11 +121,11 @@ void FolderSelectionWidget::setDirectoryList(QStringList includeDirs, QStringLis
if (exclude.contains(mountPath))
continue;
excludeList << mountPath;
if (!excludeList.contains(mountPath)) {
excludeList << mountPath;
}
}
excludeList.removeDuplicates();
Q_FOREACH (QString url, excludeList) {
QListWidgetItem* item = new QListWidgetItem(m_listWidget);
QString display = folderDisplayName(url);
......@@ -159,7 +159,7 @@ QStringList FolderSelectionWidget::includeFolders() const
}
}
if (!inExclude) {
if (!inExclude && !folders.contains(mountPath)) {
folders << mountPath;
}
}
......@@ -174,7 +174,9 @@ QStringList FolderSelectionWidget::excludeFolders() const
QListWidgetItem* item = m_listWidget->item(i);
QString url = item->data(UrlRole).toString();
folders << url;
if (!folders.contains(url)) {
folders << url;
}
}
return folders;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment