From 2ef7b206e24d9af112c8b466c006aa98e072e235 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sun, 6 Jun 2021 22:42:16 -0500 Subject: [PATCH] Scan themes in all mount paths --- src/aooptionsdialog.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index a035a74..6b42590 100644 --- a/src/aooptionsdialog.cpp +++ b/src/aooptionsdialog.cpp @@ -75,12 +75,19 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app) ui_theme_combobox = new QComboBox(ui_form_layout_widget); // Fill the combobox with the names of the themes. - QDirIterator it(ao_app->get_base_path() + "themes", QDir::Dirs, - QDirIterator::NoIteratorFlags); - while (it.hasNext()) { - QString actualname = QDir(it.next()).dirName(); - if (actualname != "." && actualname != "..") - ui_theme_combobox->addItem(actualname); + QSet themes; + QStringList bases = ao_app->get_mount_paths(); + bases.push_front(ao_app->get_base_path()); + for (const QString &base : bases) { + QDirIterator it(base + "/themes", QDir::Dirs | QDir::NoDotAndDotDot, + QDirIterator::NoIteratorFlags); + while (it.hasNext()) { + QString actualname = QDir(it.next()).dirName(); + if (!themes.contains(actualname)) { + ui_theme_combobox->addItem(actualname); + themes.insert(actualname); + } + } } QObject::connect(ui_theme_combobox, SIGNAL(currentIndexChanged(int)), this,