mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Use Launcher_ENVName for launcher environment variable names (#5226)
This commit is contained in:
commit
17048a586a
8 changed files with 19 additions and 6 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#include <QOffscreenSurface>
|
||||
#include <QOpenGLFunctions>
|
||||
#include <QProcessEnvironment>
|
||||
#include "BuildConfig.h"
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
#include <QVulkanInstance>
|
||||
|
|
@ -31,7 +32,9 @@
|
|||
namespace {
|
||||
bool vulkanInfo(QStringList& out)
|
||||
{
|
||||
if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) {
|
||||
if (!QProcessEnvironment::systemEnvironment()
|
||||
.value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME))
|
||||
.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
#ifndef Q_OS_MACOS
|
||||
|
|
@ -57,7 +60,9 @@ bool vulkanInfo(QStringList& out)
|
|||
|
||||
bool openGlInfo(QStringList& out)
|
||||
{
|
||||
if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) {
|
||||
if (!QProcessEnvironment::systemEnvironment()
|
||||
.value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME))
|
||||
.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
QOpenGLContext ctx;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ fi
|
|||
|
||||
|
||||
LAUNCHER_NAME=@Launcher_APP_BINARY_NAME@
|
||||
LAUNCHER_ENVNAME=@Launcher_ENVName@
|
||||
LAUNCHER_DIR="$(dirname "$(readlink -f "$0")")"
|
||||
echo "Launcher Dir: ${LAUNCHER_DIR}"
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ export QT_QPA_PLATFORMTHEME=xdgdesktopportal
|
|||
|
||||
# disable OpenGL and Vulkan launcher features on sharun until https://github.com/VHSgunzo/sharun/issues/35
|
||||
if [[ -f "${LAUNCHER_DIR}/sharun" ]]; then
|
||||
export LAUNCHER_DISABLE_GLVULKAN=1
|
||||
export ${LAUNCHER_ENVNAME}_DISABLE_GLVULKAN=1
|
||||
fi
|
||||
|
||||
# Just to be sure...
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
#include <QDebug>
|
||||
#include "Application.h"
|
||||
#include "BuildConfig.h"
|
||||
#include "FileSystem.h"
|
||||
#include "java/JavaInstallList.h"
|
||||
#include "java/JavaUtils.h"
|
||||
|
|
@ -155,7 +156,7 @@ JavaInstallPtr JavaUtils::GetDefaultJava()
|
|||
|
||||
QStringList addJavasFromEnv(QList<QString> javas)
|
||||
{
|
||||
auto env = qEnvironmentVariable("PRISMLAUNCHER_JAVA_PATHS"); // FIXME: use launcher name from buildconfig
|
||||
auto env = QProcessEnvironment::systemEnvironment().value(QStringLiteral("%1_JAVA_PATHS").arg(BuildConfig.LAUNCHER_ENVNAME));
|
||||
#if defined(Q_OS_WIN32)
|
||||
QList<QString> javaPaths = env.replace("\\", "/").split(QLatin1String(";"));
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <QtMath>
|
||||
#include <functional>
|
||||
|
||||
#include "BuildConfig.h"
|
||||
#include "minecraft/skins/SkinModel.h"
|
||||
#include "rainbow.h"
|
||||
#include "ui/dialogs/skins/draw/BoxGeometry.h"
|
||||
|
|
@ -331,7 +332,9 @@ void SkinOpenGLWindow::setElytraVisible(bool visible)
|
|||
|
||||
bool SkinOpenGLWindow::hasOpenGL()
|
||||
{
|
||||
if (!QProcessEnvironment::systemEnvironment().value(QStringLiteral("LAUNCHER_DISABLE_GLVULKAN")).isEmpty()) {
|
||||
if (!QProcessEnvironment::systemEnvironment()
|
||||
.value(QStringLiteral("%1_DISABLE_GLVULKAN").arg(BuildConfig.LAUNCHER_ENVNAME))
|
||||
.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue