diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-06 22:42:16 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2021-06-06 22:42:16 -0500 |
| commit | 2ef7b206e24d9af112c8b466c006aa98e072e235 (patch) | |
| tree | 969da661fab26f2b12f746e2f752dcd3cfeab54f /src/aooptionsdialog.cpp | |
| parent | 387233e9e3603eb7d346eb351f0c70c84a956a10 (diff) | |
Scan themes in all mount paths
Diffstat (limited to 'src/aooptionsdialog.cpp')
| -rw-r--r-- | src/aooptionsdialog.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/aooptionsdialog.cpp b/src/aooptionsdialog.cpp index a035a74f..6b425908 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<QString> 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, |
