1
0
Fork 0

citra_qt: Fix image file selection dialog

This commit is contained in:
zhupengfei 2018-06-28 22:35:12 +08:00
parent 438751075f
commit 0bd843f324
No known key found for this signature in database
GPG Key ID: 85B82A3E62174206
1 changed files with 5 additions and 9 deletions

View File

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