| 344 | } |
| 345 | |
| 346 | void ImportDatasetWidget::addDatasetItems(const QString& collection, const QString& category, const QString& subcategory, const QString& filter) { |
| 347 | if (!filter.isEmpty() && (category.startsWith(filter, Qt::CaseInsensitive) || subcategory.startsWith(filter, Qt::CaseInsensitive))) { |
| 348 | for (const QString& dataset : m_model->datasets(collection, category, subcategory)) |
| 349 | ui.lwDatasets->addItem(new QListWidgetItem(dataset)); |
| 350 | } else { |
| 351 | for (const QString& dataset : m_model->datasets(collection, category, subcategory)) { |
| 352 | if (filter.isEmpty() || dataset.startsWith(filter, Qt::CaseInsensitive)) |
| 353 | ui.lwDatasets->addItem(new QListWidgetItem(dataset)); |
| 354 | } |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * @brief Returns the name of the selected dataset |