Rebase: Make archive detection more robust and add it to the CLI (#1560)

* Rebase/recreate my changes and add MIME support

This commit recreates the changes proposed in #1394 on top of the
current master (b069a2acf1).
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 <insert-penguin@protonmail.com>
This commit is contained in:
Janfel
2023-01-18 00:49:18 +01:00
committed by GitHub
parent d83172e595
commit 3e02d3ff76
4 changed files with 305 additions and 163 deletions

View File

@ -11,7 +11,7 @@
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with melonDS. If not, see http://www.gnu.org/licenses/.
*/
@ -22,14 +22,18 @@
#include <QApplication>
#include <QStringList>
#include <optional>
namespace CLI {
struct CommandLineOptions
{
QStringList errorsToDisplay = {};
QStringList dsRomPath;
QStringList gbaRomPath;
std::optional<QString> dsRomPath;
std::optional<QString> dsRomArchivePath;
std::optional<QString> gbaRomPath;
std::optional<QString> gbaRomArchivePath;
bool fullscreen;
bool boot;
};