citra-emu
/
citra
Archived
1
0
Fork 0

Merge pull request #3889 from zhaowenlan1779/camera-ui-fix

citra_qt: Fix image file selection dialog
This commit is contained in:
Weiyi Wang 2018-06-28 18:36:06 +03:00 committed by GitHub
commit 3cf5c1a5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 9 deletions

View File

@ -267,16 +267,12 @@ void ConfigureCamera::setConfiguration() {
void ConfigureCamera::onToolButtonClicked() { void ConfigureCamera::onToolButtonClicked() {
stopPreviewing(); stopPreviewing();
int camera_selection = getSelectedCameraIndex(); QList<QByteArray> types = QImageReader::supportedImageFormats();
QString filter; QList<QString> temp_filters;
if (camera_name[camera_selection] == "image") { for (const QByteArray& type : types) {
QList<QByteArray> types = QImageReader::supportedImageFormats(); temp_filters << QString("*." + QString(type));
QList<QString> temp_filters;
for (const QByteArray& type : types) {
temp_filters << QString("*." + QString(type));
}
filter = tr("Supported image files (%1)").arg(temp_filters.join(" "));
} }
QString filter = tr("Supported image files (%1)").arg(temp_filters.join(" "));
QString path = QFileDialog::getOpenFileName(this, tr("Open File"), ".", filter); QString path = QFileDialog::getOpenFileName(this, tr("Open File"), ".", filter);
if (!path.isEmpty()) { if (!path.isEmpty()) {
ui->camera_file->setText(path); ui->camera_file->setText(path);