Qt/MemoryCardEditor: Remove duplicate browse functionality
This commit is contained in:
parent
f112222fae
commit
3088138c3c
|
@ -92,7 +92,6 @@ void MemoryCardEditorDialog::populateComboBox(QComboBox* cb)
|
||||||
cb->clear();
|
cb->clear();
|
||||||
|
|
||||||
cb->addItem(QString());
|
cb->addItem(QString());
|
||||||
cb->addItem(tr("Browse..."));
|
|
||||||
|
|
||||||
const std::string base_path(g_host_interface->GetUserDirectoryRelativePath("memcards"));
|
const std::string base_path(g_host_interface->GetUserDirectoryRelativePath("memcards"));
|
||||||
FileSystem::FindResultsArray results;
|
FileSystem::FindResultsArray results;
|
||||||
|
@ -111,24 +110,7 @@ void MemoryCardEditorDialog::populateComboBox(QComboBox* cb)
|
||||||
|
|
||||||
void MemoryCardEditorDialog::loadCardFromComboBox(Card* card, int index)
|
void MemoryCardEditorDialog::loadCardFromComboBox(Card* card, int index)
|
||||||
{
|
{
|
||||||
QString filename;
|
QString filename = card->path_cb->itemData(index).toString();
|
||||||
if (index == 1)
|
|
||||||
{
|
|
||||||
filename = QDir::toNativeSeparators(
|
|
||||||
QFileDialog::getOpenFileName(this, tr("Select Memory Card"), QString(), tr(MEMORY_CARD_IMAGE_FILTER)));
|
|
||||||
if (!filename.isEmpty())
|
|
||||||
{
|
|
||||||
// add to combo box
|
|
||||||
QFileInfo file(filename);
|
|
||||||
QSignalBlocker sb(card->path_cb);
|
|
||||||
card->path_cb->addItem(file.baseName(), QVariant(filename));
|
|
||||||
card->path_cb->setCurrentIndex(card->path_cb->count() - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
filename = card->path_cb->itemData(index).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filename.isEmpty())
|
if (filename.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue