Scan themes in all mount paths
This commit is contained in:
parent
387233e9e3
commit
2ef7b206e2
@ -75,12 +75,19 @@ AOOptionsDialog::AOOptionsDialog(QWidget *parent, AOApplication *p_ao_app)
|
|||||||
ui_theme_combobox = new QComboBox(ui_form_layout_widget);
|
ui_theme_combobox = new QComboBox(ui_form_layout_widget);
|
||||||
|
|
||||||
// Fill the combobox with the names of the themes.
|
// Fill the combobox with the names of the themes.
|
||||||
QDirIterator it(ao_app->get_base_path() + "themes", QDir::Dirs,
|
QSet<QString> themes;
|
||||||
QDirIterator::NoIteratorFlags);
|
QStringList bases = ao_app->get_mount_paths();
|
||||||
while (it.hasNext()) {
|
bases.push_front(ao_app->get_base_path());
|
||||||
QString actualname = QDir(it.next()).dirName();
|
for (const QString &base : bases) {
|
||||||
if (actualname != "." && actualname != "..")
|
QDirIterator it(base + "/themes", QDir::Dirs | QDir::NoDotAndDotDot,
|
||||||
ui_theme_combobox->addItem(actualname);
|
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,
|
QObject::connect(ui_theme_combobox, SIGNAL(currentIndexChanged(int)), this,
|
||||||
|
Loading…
Reference in New Issue
Block a user