Qt: More missing toNativeSeparators() calls

This commit is contained in:
Stenzek 2024-04-04 16:59:52 +10:00
parent 4270dd0804
commit 0a17cf7db8
No known key found for this signature in database
4 changed files with 58 additions and 58 deletions

View File

@ -191,8 +191,7 @@ void CheatManagerDialog::connectUi()
connect(m_ui.scanTable, &QTableWidget::itemChanged, this, &CheatManagerDialog::scanItemChanged); connect(m_ui.scanTable, &QTableWidget::itemChanged, this, &CheatManagerDialog::scanItemChanged);
connect(m_ui.watchTable, &QTableWidget::itemChanged, this, &CheatManagerDialog::watchItemChanged); connect(m_ui.watchTable, &QTableWidget::itemChanged, this, &CheatManagerDialog::watchItemChanged);
connect(g_emu_thread, &EmuThread::cheatEnabled, this, connect(g_emu_thread, &EmuThread::cheatEnabled, this, &CheatManagerDialog::setCheatCheckState);
&CheatManagerDialog::setCheatCheckState);
} }
void CheatManagerDialog::showEvent(QShowEvent* event) void CheatManagerDialog::showEvent(QShowEvent* event)
@ -354,8 +353,7 @@ CheatList* CheatManagerDialog::getCheatList() const
} }
if (!list) if (!list)
{ {
Host::RunOnCPUThread( Host::RunOnCPUThread([]() { System::SetCheatList(std::make_unique<CheatList>()); }, true);
[]() { System::SetCheatList(std::make_unique<CheatList>()); }, true);
list = System::GetCheatList(); list = System::GetCheatList();
} }
@ -655,7 +653,8 @@ void CheatManagerDialog::importClicked()
void CheatManagerDialog::importFromFileTriggered() void CheatManagerDialog::importFromFileTriggered()
{ {
const QString filter(tr("PCSXR/Libretro Cheat Files (*.cht *.txt);;All Files (*.*)")); const QString filter(tr("PCSXR/Libretro Cheat Files (*.cht *.txt);;All Files (*.*)"));
const QString filename(QFileDialog::getOpenFileName(this, tr("Import Cheats"), QString(), filter)); const QString filename =
QDir::toNativeSeparators(QFileDialog::getOpenFileName(this, tr("Import Cheats"), QString(), filter));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@ -702,7 +701,8 @@ void CheatManagerDialog::importFromTextTriggered()
void CheatManagerDialog::exportClicked() void CheatManagerDialog::exportClicked()
{ {
const QString filter(tr("PCSXR Cheat Files (*.cht);;All Files (*.*)")); const QString filter(tr("PCSXR Cheat Files (*.cht);;All Files (*.*)"));
const QString filename(QFileDialog::getSaveFileName(this, tr("Export Cheats"), QString(), filter)); const QString filename =
QDir::toNativeSeparators(QFileDialog::getSaveFileName(this, tr("Export Cheats"), QString(), filter));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@ -748,8 +748,8 @@ void CheatManagerDialog::addToWatchClicked()
for (int index = indexFirst; index <= indexLast; index++) for (int index = indexFirst; index <= indexLast; index++)
{ {
const MemoryScan::Result& res = m_scanner.GetResults()[static_cast<u32>(index)]; const MemoryScan::Result& res = m_scanner.GetResults()[static_cast<u32>(index)];
m_watch.AddEntry(fmt::format("0x{:08x}", res.address), res.address, m_scanner.GetSize(), m_watch.AddEntry(fmt::format("0x{:08x}", res.address), res.address, m_scanner.GetSize(), m_scanner.GetValueSigned(),
m_scanner.GetValueSigned(), false); false);
updateWatch(); updateWatch();
} }
} }
@ -775,8 +775,8 @@ void CheatManagerDialog::addManualWatchAddressClicked()
else if (index == 2 || index == 5) else if (index == 2 || index == 5)
address.value() &= 0xFFFFFFFC; address.value() &= 0xFFFFFFFC;
m_watch.AddEntry(fmt::format("0x{:08x}", address.value()), address.value(), m_watch.AddEntry(fmt::format("0x{:08x}", address.value()), address.value(), static_cast<MemoryAccessSize>(index % 3),
static_cast<MemoryAccessSize>(index % 3), (index > 3), false); (index > 3), false);
updateWatch(); updateWatch();
} }

View File

@ -627,7 +627,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(ControllerBindingWidge
QPushButton* browse_button = new QPushButton(tr("Browse..."), this); QPushButton* browse_button = new QPushButton(tr("Browse..."), this);
SettingWidgetBinder::BindWidgetToStringSetting(sif, le, section, std::move(key_name), si.StringDefaultValue()); SettingWidgetBinder::BindWidgetToStringSetting(sif, le, section, std::move(key_name), si.StringDefaultValue());
connect(browse_button, &QPushButton::clicked, [this, le]() { connect(browse_button, &QPushButton::clicked, [this, le]() {
QString path = QFileDialog::getOpenFileName(this, tr("Select File")); QString path = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this, tr("Select File")));
if (!path.isEmpty()) if (!path.isEmpty())
le->setText(path); le->setText(path);
}); });

View File

@ -926,12 +926,12 @@ void MainWindow::populateLoadStateMenu(const char* game_serial, QMenu* menu)
menu->clear(); menu->clear();
connect(menu->addAction(tr("Load From File...")), &QAction::triggered, []() { connect(menu->addAction(tr("Load From File...")), &QAction::triggered, []() {
const QString path( const QString path = QDir::toNativeSeparators(
QFileDialog::getOpenFileName(g_main_window, tr("Select Save State File"), QString(), tr("Save States (*.sav)"))); QFileDialog::getOpenFileName(g_main_window, tr("Select Save State File"), QString(), tr("Save States (*.sav)")));
if (path.isEmpty()) if (path.isEmpty())
return; return;
g_emu_thread->loadState(QDir::toNativeSeparators(path)); g_emu_thread->loadState(path);
}); });
QAction* load_from_state = menu->addAction(tr("Undo Load State")); QAction* load_from_state = menu->addAction(tr("Undo Load State"));
load_from_state->setEnabled(System::CanUndoLoadState()); load_from_state->setEnabled(System::CanUndoLoadState());
@ -968,7 +968,7 @@ void MainWindow::populateSaveStateMenu(const char* game_serial, QMenu* menu)
if (!System::IsValid()) if (!System::IsValid())
return; return;
const QString path( const QString path = QDir::toNativeSeparators(
QFileDialog::getSaveFileName(g_main_window, tr("Select Save State File"), QString(), tr("Save States (*.sav)"))); QFileDialog::getSaveFileName(g_main_window, tr("Select Save State File"), QString(), tr("Save States (*.sav)")));
if (path.isEmpty()) if (path.isEmpty())
return; return;
@ -1275,8 +1275,8 @@ void MainWindow::onStartBIOSActionTriggered()
void MainWindow::onChangeDiscFromFileActionTriggered() void MainWindow::onChangeDiscFromFileActionTriggered()
{ {
QString filename = QString filename = QDir::toNativeSeparators(
QFileDialog::getOpenFileName(this, tr("Select Disc Image"), QString(), tr(DISC_IMAGE_FILTER), nullptr); QFileDialog::getOpenFileName(this, tr("Select Disc Image"), QString(), tr(DISC_IMAGE_FILTER), nullptr));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@ -2163,24 +2163,24 @@ void MainWindow::connectSignals()
g_emu_thread->stopDumpingAudio(); g_emu_thread->stopDumpingAudio();
}); });
connect(m_ui.actionDumpRAM, &QAction::triggered, [this]() { connect(m_ui.actionDumpRAM, &QAction::triggered, [this]() {
const QString filename = const QString filename = QDir::toNativeSeparators(
QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)")); QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)")));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
g_emu_thread->dumpRAM(filename); g_emu_thread->dumpRAM(filename);
}); });
connect(m_ui.actionDumpVRAM, &QAction::triggered, [this]() { connect(m_ui.actionDumpVRAM, &QAction::triggered, [this]() {
const QString filename = QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), const QString filename = QDir::toNativeSeparators(QFileDialog::getSaveFileName(
tr("Binary Files (*.bin);;PNG Images (*.png)")); this, tr("Destination File"), QString(), tr("Binary Files (*.bin);;PNG Images (*.png)")));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
g_emu_thread->dumpVRAM(filename); g_emu_thread->dumpVRAM(filename);
}); });
connect(m_ui.actionDumpSPURAM, &QAction::triggered, [this]() { connect(m_ui.actionDumpSPURAM, &QAction::triggered, [this]() {
const QString filename = const QString filename = QDir::toNativeSeparators(
QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)")); QFileDialog::getSaveFileName(this, tr("Destination File"), QString(), tr("Binary Files (*.bin)")));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@ -2319,42 +2319,42 @@ void MainWindow::setStyleFromSettings()
qApp->setPalette(darkPalette); qApp->setPalette(darkPalette);
} }
else if (theme == "cobaltsky") else if (theme == "cobaltsky")
{ {
// Custom palette by KamFretoZ, A soothing deep royal blue // Custom palette by KamFretoZ, A soothing deep royal blue
// that are meant to be easy on the eyes as the main color. // that are meant to be easy on the eyes as the main color.
// Alternative dark theme. // Alternative dark theme.
qApp->setStyle(QStyleFactory::create("Fusion")); qApp->setStyle(QStyleFactory::create("Fusion"));
const QColor gray(150, 150, 150); const QColor gray(150, 150, 150);
const QColor royalBlue(29, 41, 81); const QColor royalBlue(29, 41, 81);
const QColor darkishBlue(17, 30, 108); const QColor darkishBlue(17, 30, 108);
const QColor lighterBlue(25, 32, 130); const QColor lighterBlue(25, 32, 130);
const QColor highlight(36, 93, 218); const QColor highlight(36, 93, 218);
const QColor link(0, 202, 255); const QColor link(0, 202, 255);
QPalette darkPalette; QPalette darkPalette;
darkPalette.setColor(QPalette::Window, royalBlue); darkPalette.setColor(QPalette::Window, royalBlue);
darkPalette.setColor(QPalette::WindowText, Qt::white); darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, royalBlue.lighter()); darkPalette.setColor(QPalette::Base, royalBlue.lighter());
darkPalette.setColor(QPalette::AlternateBase, darkishBlue); darkPalette.setColor(QPalette::AlternateBase, darkishBlue);
darkPalette.setColor(QPalette::ToolTipBase, darkishBlue); darkPalette.setColor(QPalette::ToolTipBase, darkishBlue);
darkPalette.setColor(QPalette::ToolTipText, Qt::white); darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white); darkPalette.setColor(QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Button, lighterBlue); darkPalette.setColor(QPalette::Button, lighterBlue);
darkPalette.setColor(QPalette::ButtonText, Qt::white); darkPalette.setColor(QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::Link, link); darkPalette.setColor(QPalette::Link, link);
darkPalette.setColor(QPalette::Highlight, highlight); darkPalette.setColor(QPalette::Highlight, highlight);
darkPalette.setColor(QPalette::HighlightedText, Qt::white); darkPalette.setColor(QPalette::HighlightedText, Qt::white);
darkPalette.setColor(QPalette::Active, QPalette::Button, lighterBlue); darkPalette.setColor(QPalette::Active, QPalette::Button, lighterBlue);
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray); darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray); darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray); darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Light, gray); darkPalette.setColor(QPalette::Disabled, QPalette::Light, gray);
qApp->setPalette(darkPalette); qApp->setPalette(darkPalette);
} }
else if (theme == "greymatter") else if (theme == "greymatter")
{ {
qApp->setStyle(QStyleFactory::create("Fusion")); qApp->setStyle(QStyleFactory::create("Fusion"));

View File

@ -510,8 +510,8 @@ void MemoryCardEditorWindow::importCard(Card* card)
{ {
promptForSave(card); promptForSave(card);
QString filename = QString filename = QDir::toNativeSeparators(
QFileDialog::getOpenFileName(this, tr("Select Import File"), QString(), tr(MEMORY_CARD_IMPORT_FILTER)); QFileDialog::getOpenFileName(this, tr("Select Import File"), QString(), tr(MEMORY_CARD_IMPORT_FILTER)));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;
@ -556,8 +556,8 @@ void MemoryCardEditorWindow::formatCard(Card* card)
void MemoryCardEditorWindow::importSaveFile(Card* card) void MemoryCardEditorWindow::importSaveFile(Card* card)
{ {
QString filename = QString filename = QDir::toNativeSeparators(
QFileDialog::getOpenFileName(this, tr("Select Import Save File"), QString(), tr(SINGLE_SAVEFILE_FILTER)); QFileDialog::getOpenFileName(this, tr("Select Import Save File"), QString(), tr(SINGLE_SAVEFILE_FILTER)));
if (filename.isEmpty()) if (filename.isEmpty())
return; return;