mirror of
https://github.com/jellyfin/jellyfin-media-player.git
synced 2024-11-23 05:59:43 +00:00
Add --platform option. (#159)
This commit is contained in:
parent
28ccf00fae
commit
5985c40a16
11
src/main.cpp
11
src/main.cpp
@ -107,10 +107,15 @@ int main(int argc, char *argv[])
|
||||
scaleOption.setValueName("scale");
|
||||
scaleOption.setDefaultValue("auto");
|
||||
|
||||
auto platformOption = QCommandLineOption("platform", "Equivalant to QT_QPA_PLATFORM.");
|
||||
platformOption.setValueName("platform");
|
||||
platformOption.setDefaultValue("default");
|
||||
|
||||
auto devOption = QCommandLineOption("remote-debugging-port", "Port number for devtools.");
|
||||
devOption.setValueName("port");
|
||||
parser.addOption(scaleOption);
|
||||
parser.addOption(devOption);
|
||||
parser.addOption(platformOption);
|
||||
|
||||
char **newArgv = appendCommandLineArguments(argc, argv, g_qtFlags);
|
||||
int newArgc = argc + g_qtFlags.size();
|
||||
@ -155,6 +160,12 @@ int main(int argc, char *argv[])
|
||||
else if (scale != "none")
|
||||
qputenv("QT_SCALE_FACTOR", scale.toUtf8());
|
||||
|
||||
auto platform = parser.value("platform");
|
||||
if (!(platform.isEmpty() || platform == "default"))
|
||||
{
|
||||
qputenv("QT_QPA_PLATFORM", platform.toUtf8());
|
||||
}
|
||||
|
||||
QApplication app(newArgc, newArgv);
|
||||
app.setApplicationName("Jellyfin Media Player");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user