Skip to content

Commit

Permalink
Qt: Fix a couple more missing native separator calls
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Apr 4, 2024
1 parent 7066369 commit 29a961a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
13 changes: 8 additions & 5 deletions pcsx2-qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "common/FileSystem.h"

#include <QtCore/QDateTime>
#include <QtCore/QDir>
#include <QtGui/QCloseEvent>
#include <QtWidgets/QFileDialog>
#include <QtWidgets/QInputDialog>
Expand Down Expand Up @@ -727,7 +728,7 @@ void MainWindow::onToolsVideoCaptureToggled(bool checked)
const QString filter(tr("%1 Files (*.%2)").arg(container.toUpper()).arg(container));

QString path(QStringLiteral("%1.%2").arg(QString::fromStdString(GSGetBaseVideoFilename())).arg(container));
path = QFileDialog::getSaveFileName(this, tr("Video Capture"), path, filter);
path = QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Video Capture"), path, filter));
if (path.isEmpty())
return;

Expand Down Expand Up @@ -1425,8 +1426,8 @@ void MainWindow::onStartBIOSActionTriggered()
void MainWindow::onChangeDiscFromFileActionTriggered()
{
VMLock lock(pauseAndLockVM());
QString filename =
QFileDialog::getOpenFileName(lock.getDialogParent(), tr("Select Disc Image"), QString(), tr(DISC_IMAGE_FILTER), nullptr);
QString filename = QDir::toNativeSeparators(
QFileDialog::getOpenFileName(lock.getDialogParent(), tr("Select Disc Image"), QString(), tr(DISC_IMAGE_FILTER), nullptr));
if (filename.isEmpty())
return;

Expand Down Expand Up @@ -2770,7 +2771,8 @@ void MainWindow::populateLoadStateMenu(QMenu* menu, const QString& filename, con

QAction* action = menu->addAction(is_right_click_menu ? tr("Load State File...") : tr("Load From File..."));
connect(action, &QAction::triggered, [this, filename]() {
const QString path(QFileDialog::getOpenFileName(this, tr("Select Save State File"), QString(), tr("Save States (*.p2s *.p2s.backup)")));
const QString path = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this,
tr("Select Save State File"), QString(), tr("Save States (*.p2s *.p2s.backup)")));
if (path.isEmpty())
return;

Expand Down Expand Up @@ -2840,7 +2842,8 @@ void MainWindow::populateSaveStateMenu(QMenu* menu, const QString& serial, quint
return;

connect(menu->addAction(tr("Save To File...")), &QAction::triggered, [this]() {
const QString path(QFileDialog::getSaveFileName(this, tr("Select Save State File"), QString(), tr("Save States (*.p2s)")));
const QString path = QDir::toNativeSeparators(QFileDialog::getSaveFileName(
this, tr("Select Save State File"), QString(), tr("Save States (*.p2s)")));
if (path.isEmpty())
return;

Expand Down
6 changes: 4 additions & 2 deletions pcsx2-qt/Tools/InputRecording/NewInputRecordingDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-FileCopyrightText: 2002-2023 PCSX2 Dev Team
// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
// SPDX-License-Identifier: LGPL-3.0+

#include "NewInputRecordingDlg.h"

#include "QtUtils.h"
#include <QtCore/QDir>
#include <QtCore/QString>
#include <QtWidgets/QDialog>
#include <QtWidgets/qfiledialog.h>
Expand Down Expand Up @@ -66,7 +67,8 @@ void NewInputRecordingDlg::onRecordingTypeSaveStateChecked(bool checked)
void NewInputRecordingDlg::onBrowseForPathClicked()
{
QString filter = tr("Input Recording Files (*.p2m2)");
QString filename = QFileDialog::getSaveFileName(this, tr("Select a File"), QString(), filter, &filter);
QString filename = QDir::toNativeSeparators(QFileDialog::getSaveFileName(
this, tr("Select a File"), QString(), filter, &filter));
if (filename.isEmpty())
return;

Expand Down

0 comments on commit 29a961a

Please sign in to comment.