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;
 | 
				
			||||||
 | 
					  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);
 | 
					                    QDirIterator::NoIteratorFlags);
 | 
				
			||||||
    while (it.hasNext()) {
 | 
					    while (it.hasNext()) {
 | 
				
			||||||
      QString actualname = QDir(it.next()).dirName();
 | 
					      QString actualname = QDir(it.next()).dirName();
 | 
				
			||||||
    if (actualname != "." && actualname != "..")
 | 
					      if (!themes.contains(actualname)) {
 | 
				
			||||||
        ui_theme_combobox->addItem(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