Qt: Show paths in native format on Win32.

This commit is contained in:
BearOso 2024-10-28 17:32:29 -05:00
parent 81f189cf57
commit fd05ca7df5
2 changed files with 6 additions and 2 deletions

View File

@ -522,7 +522,9 @@ void EmuMainWindow::populateRecentlyUsed()
for (int i = 0; i < app->config->recently_used.size(); i++)
{
auto &string = app->config->recently_used[i];
auto action = recent_menu->addAction(QString("&%1: %2").arg(i).arg(QString::fromStdString(string)));
auto action = recent_menu->addAction(QString("&%1: %2")
.arg(i)
.arg(QDir::toNativeSeparators(QString::fromStdString(string))));
connect(action, &QAction::triggered, [&, string] {
openFile(string);
});

View File

@ -45,7 +45,7 @@ void FoldersPanel::refreshEntry(QComboBox *combo, QLineEdit *lineEdit, QPushButt
combo->setCurrentIndex(*location);
if (custom)
{
lineEdit->setText(QString::fromUtf8(*folder));
lineEdit->setText(QDir::toNativeSeparators(QString::fromUtf8(*folder)));
}
else if (*location == EmuConfig::eConfigDirectory)
{
@ -55,6 +55,7 @@ void FoldersPanel::refreshEntry(QComboBox *combo, QLineEdit *lineEdit, QPushButt
rom_dir = QString::fromStdString(app->getContentFolder());
if (rom_dir.isEmpty())
rom_dir = QString::fromStdString(app->config->last_rom_folder);
rom_dir = QDir::toNativeSeparators(rom_dir);
lineEdit->setText("ROM Folder: " + rom_dir);
}
@ -72,6 +73,7 @@ void FoldersPanel::refreshEntry(QComboBox *combo, QLineEdit *lineEdit, QPushButt
if (!dialog.exec())
return;
*folder = dialog.selectedFiles().at(0).toUtf8();
*folder = QDir::toNativeSeparators(QString::fromUtf8(*folder)).toStdString();
lineEdit->setText(QString::fromStdString(*folder));
app->updateSettings();
});