mirror of
https://github.com/libretro/mgba.git
synced 2024-11-23 16:10:01 +00:00
Qt: Expand romFilters functionality
This commit is contained in:
parent
131b983894
commit
8610147ad7
@ -65,28 +65,36 @@ bool convertAddress(const QHostAddress* input, Address* output) {
|
||||
return true;
|
||||
}
|
||||
|
||||
QString romFilters(bool includeMvl) {
|
||||
QString romFilters(bool includeMvl, mPlatform platform, bool rawOnly) {
|
||||
QStringList filters;
|
||||
QStringList formats;
|
||||
|
||||
#ifdef M_CORE_GBA
|
||||
QStringList gbaFormats{
|
||||
"*.gba",
|
||||
#if defined(USE_LIBZIP) || defined(USE_MINIZIP)
|
||||
"*.zip",
|
||||
#endif
|
||||
#ifdef USE_LZMA
|
||||
"*.7z",
|
||||
#endif
|
||||
#ifdef USE_ELF
|
||||
"*.elf",
|
||||
#endif
|
||||
"*.agb",
|
||||
"*.mb",
|
||||
"*.rom",
|
||||
"*.bin"};
|
||||
formats.append(gbaFormats);
|
||||
filters.append(QCoreApplication::translate("QGBA", "Game Boy Advance ROMs (%1)", nullptr).arg(gbaFormats.join(QChar(' '))));
|
||||
if (!rawOnly) {
|
||||
gbaFormats += QStringList{
|
||||
#if defined(USE_LIBZIP) || defined(USE_MINIZIP)
|
||||
"*.zip",
|
||||
#endif
|
||||
#ifdef USE_LZMA
|
||||
"*.7z",
|
||||
#endif
|
||||
#ifdef USE_ELF
|
||||
"*.elf",
|
||||
#endif
|
||||
};
|
||||
}
|
||||
if (platform == mPLATFORM_NONE || platform == mPLATFORM_GBA) {
|
||||
formats.append(gbaFormats);
|
||||
}
|
||||
if (platform == mPLATFORM_NONE) {
|
||||
filters.append(QCoreApplication::translate("QGBA", "Game Boy Advance ROMs (%1)", nullptr).arg(gbaFormats.join(QChar(' '))));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef M_CORE_GB
|
||||
@ -94,16 +102,25 @@ QString romFilters(bool includeMvl) {
|
||||
"*.gb",
|
||||
"*.gbc",
|
||||
"*.sgb",
|
||||
#if defined(USE_LIBZIP) || defined(USE_MINIZIP)
|
||||
"*.zip",
|
||||
#endif
|
||||
#ifdef USE_LZMA
|
||||
"*.7z",
|
||||
#endif
|
||||
"*.rom",
|
||||
"*.bin"};
|
||||
formats.append(gbFormats);
|
||||
filters.append(QCoreApplication::translate("QGBA", "Game Boy ROMs (%1)", nullptr).arg(gbFormats.join(QChar(' '))));
|
||||
|
||||
if (!rawOnly) {
|
||||
gbFormats += QStringList{
|
||||
#if defined(USE_LIBZIP) || defined(USE_MINIZIP)
|
||||
"*.zip",
|
||||
#endif
|
||||
#ifdef USE_LZMA
|
||||
"*.7z",
|
||||
#endif
|
||||
};
|
||||
}
|
||||
if (platform == mPLATFORM_NONE || platform == mPLATFORM_GBA) {
|
||||
formats.append(gbFormats);
|
||||
}
|
||||
if (platform == mPLATFORM_NONE) {
|
||||
filters.append(QCoreApplication::translate("QGBA", "Game Boy ROMs (%1)", nullptr).arg(gbFormats.join(QChar(' '))));
|
||||
}
|
||||
#endif
|
||||
|
||||
formats.removeDuplicates();
|
||||
|
@ -112,7 +112,7 @@ constexpr int saturateCast<int, unsigned>(unsigned value) {
|
||||
return static_cast<int>(value);
|
||||
}
|
||||
|
||||
QString romFilters(bool includeMvl = false);
|
||||
QString romFilters(bool includeMvl = false, mPlatform platform = mPLATFORM_NONE, bool rawOnly = false);
|
||||
bool extractMatchingFile(VDir* dir, std::function<QString (VDirEntry*)> filter);
|
||||
|
||||
QString keyName(int key);
|
||||
|
Loading…
Reference in New Issue
Block a user