mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
Memcard Editor: Fix relative shared paths not opening in Memcard Editor by default
This commit is contained in:
parent
bb528fb15c
commit
51eb494340
|
@ -950,7 +950,7 @@ void QtHostInterface::populateGameListContextMenu(const GameListEntry* entry, QW
|
||||||
|
|
||||||
QAction* open_memory_cards_action = menu->addAction(tr("Edit Memory Cards..."));
|
QAction* open_memory_cards_action = menu->addAction(tr("Edit Memory Cards..."));
|
||||||
connect(open_memory_cards_action, &QAction::triggered, [this, entry]() {
|
connect(open_memory_cards_action, &QAction::triggered, [this, entry]() {
|
||||||
std::string paths[2];
|
QString paths[2];
|
||||||
for (u32 i = 0; i < 2; i++)
|
for (u32 i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
MemoryCardType type = g_settings.memory_card_types[i];
|
MemoryCardType type = g_settings.memory_card_types[i];
|
||||||
|
@ -962,21 +962,29 @@ void QtHostInterface::populateGameListContextMenu(const GameListEntry* entry, QW
|
||||||
case MemoryCardType::None:
|
case MemoryCardType::None:
|
||||||
continue;
|
continue;
|
||||||
case MemoryCardType::Shared:
|
case MemoryCardType::Shared:
|
||||||
paths[i] =
|
if (g_settings.memory_card_paths[i].empty())
|
||||||
g_settings.memory_card_paths[i].empty() ? GetSharedMemoryCardPath(i) : g_settings.memory_card_paths[i];
|
{
|
||||||
|
paths[i] = QString::fromStdString(GetSharedMemoryCardPath(i));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
QFileInfo path(QString::fromStdString(g_settings.memory_card_paths[i]));
|
||||||
|
path.makeAbsolute();
|
||||||
|
paths[i] = QDir::toNativeSeparators(path.canonicalFilePath());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MemoryCardType::PerGame:
|
case MemoryCardType::PerGame:
|
||||||
paths[i] = GetGameMemoryCardPath(entry->code.c_str(), i);
|
paths[i] = QString::fromStdString(GetGameMemoryCardPath(entry->code.c_str(), i));
|
||||||
break;
|
break;
|
||||||
case MemoryCardType::PerGameTitle:
|
case MemoryCardType::PerGameTitle:
|
||||||
paths[i] = GetGameMemoryCardPath(entry->title.c_str(), i);
|
paths[i] = QString::fromStdString(GetGameMemoryCardPath(entry->title.c_str(), i));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_main_window->openMemoryCardEditor(QString::fromStdString(paths[0]), QString::fromStdString(paths[1]));
|
m_main_window->openMemoryCardEditor(paths[0], paths[1]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const bool has_any_states = resume_action->isEnabled() || load_state_menu->isEnabled();
|
const bool has_any_states = resume_action->isEnabled() || load_state_menu->isEnabled();
|
||||||
|
|
Loading…
Reference in a new issue