-
-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make archive detection more robust and add it to the CLI #1394
base: master
Are you sure you want to change the base?
Conversation
This allows me to simplify the functions checking for file extensions.
This function is a safer alternative to the ‘filename.split('|')’ idiom, that also checks for the existence of the files being referenced. Now it should be harder to get melonDS to hang/crash/segfault by feeding it invalid paths.
The only thing not renamed in accordance with the style guide is MainWindow::splitArchivePath, because it would be jarring to have a single member function looking different from the rest.
I've been (kinda) maintaining my own fork with the following changes:
The third feature has been implemented in #1333, this PR implements the second. The only thing left to do is making the emulator fullscreen when started from CLI. |
When launched through a file association on Linux, the ROM path is passed to the executable as an argument, and in a case like that having the emulator suddenly open in full screen would be rather surprising and undesirable. Open as fullscreen (among several other things) should be a command line option. |
Yeah, I know - obviously that would be the preferred solution. PRs are welcome. But if you aren't going to write that it's better to reduce this request to a minimum otherwise there's a chance that progress will stall and then nobody wins. If Janfel doesn't want to implement that, I'll just merge this PR into my own fork and apply my changes on top. Users wanting this functionality will hopefully find my fork and figure out how to download/compile it. |
I might look into improving the CLI, but that is a separate issue and out of scope for this PR. |
No worries, I'll just snatch your changes for the time being. I don't need an overcomplicated solution so I'm fine with using Anuskuss/melonDS. |
Now the input dialog for choosing an archive member only shows members that have a recognized file extension, just like the default file picker. The input dialog also isn't shown for archives with multiple members where only a single member has a recognized file extension.
melonDS 0.9.5 has some basic functionality for this now. It's not perfect because it doesn't detect if it's a ROM or an archive and it doesn't autoload single ROM archives (you have to use it in conjunction with |
It does autoload archives iirc, in the same way that File>Open does |
This commit recreates the changes proposed in melonDS-emu#1394 on top of the current master (b069a2a). This also adds support for determining filetypes using the MIME database provided by `QMimeDatabase`.
* Rebase/recreate my changes and add MIME support This commit recreates the changes proposed in #1394 on top of the current master (b069a2a). This also adds support for determining filetypes using the MIME database provided by `QMimeDatabase`. * Move member syntax warning to a more appropriate place * Deduplicate member syntax warning * Change warning from "vertical bars" to "|" * Conform brace placement to coding style * Fix QFileDialog filter when ArchiveExtensions is empty * Final cleanup and fixes - Changes the NDS and GBA ROM MIME-Type constants to QStrings. - Removes a leftover warning message. - Uses Type() syntax instead of Type{} syntax for temporaries. * Explain the origin of the supported archive list Co-authored-by: Jan Felix Langenbach <[email protected]>
10c70eb
to
a7575ec
Compare
This PR
NdsRomExtensions
,GbaRomExtensions
andArchiveExtensions
),MainWindow::preloadROMs
,melonDS
with invalid parameters, and.tar.zst
,.tar.lz4
and short forms (.tgz
,.txz
,.tzst
, ...) to the list of supported archive file extensions, fixing Add *.tar.zst (zstd) to Archived ROMs support #1063.If I have missed something or if
MainWindow::preloadROMs
isn’t the right place to do what I’m trying to do, please let me know.