mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
Deepin System Proxy Configuration is Finally Saved
removing this nag due to: https://github.com/linuxdeepin/go-lib/issues/15#issuecomment-714627960 big thanks to @xmuli, @RigoLigo, @felixonmars and all other contributors involved!
This commit is contained in:
parent
e1a9cf4029
commit
054c3c0695
@ -8,7 +8,6 @@ namespace Qv2ray::base
|
|||||||
struct Qv2rayRuntimeConfig
|
struct Qv2rayRuntimeConfig
|
||||||
{
|
{
|
||||||
bool screenShotHideQv2ray = false;
|
bool screenShotHideQv2ray = false;
|
||||||
bool deepinHorribleProxyHint = false;
|
|
||||||
};
|
};
|
||||||
inline base::Qv2rayRuntimeConfig RuntimeConfig = base::Qv2rayRuntimeConfig();
|
inline base::Qv2rayRuntimeConfig RuntimeConfig = base::Qv2rayRuntimeConfig();
|
||||||
} // namespace Qv2ray::base
|
} // namespace Qv2ray::base
|
||||||
|
@ -237,7 +237,6 @@ namespace Qv2ray::components::proxy
|
|||||||
actions << ProcessArgument{ "gsettings", { "set", "org.gnome.system.proxy", "mode", "manual" } };
|
actions << ProcessArgument{ "gsettings", { "set", "org.gnome.system.proxy", "mode", "manual" } };
|
||||||
//
|
//
|
||||||
bool isKDE = qEnvironmentVariable("XDG_SESSION_DESKTOP") == "KDE" || qEnvironmentVariable("XDG_SESSION_DESKTOP") == "plasma";
|
bool isKDE = qEnvironmentVariable("XDG_SESSION_DESKTOP") == "KDE" || qEnvironmentVariable("XDG_SESSION_DESKTOP") == "plasma";
|
||||||
bool isDDE = !isKDE && qEnvironmentVariable("XDG_CURRENT_DESKTOP").toLower() == "deepin";
|
|
||||||
const auto configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
const auto configPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -328,26 +327,6 @@ namespace Qv2ray::components::proxy
|
|||||||
{
|
{
|
||||||
LOG("Something wrong when setting proxies.");
|
LOG("Something wrong when setting proxies.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Post-Actions for HTTP on Deepin Desktop Environment.
|
|
||||||
if (isDDE && hasHTTP)
|
|
||||||
{
|
|
||||||
if (!RuntimeConfig.deepinHorribleProxyHint)
|
|
||||||
{
|
|
||||||
RuntimeConfig.deepinHorribleProxyHint = true;
|
|
||||||
const auto deepinWarnTitle = QObject::tr("Deepin Detected");
|
|
||||||
const auto deepinWarnMessage =
|
|
||||||
QObject::tr("Deepin plays smart and sets you the wrong HTTPS_PROXY, FTP_PROXY environment variable.") + NEWLINE + //
|
|
||||||
QObject::tr("The origin scheme http is wrongly replaced by https and ftp, causing the problem.") + NEWLINE + //
|
|
||||||
QObject::tr("Qv2ray cannot help you change them back. Please don't blame us if things go wrong."); //
|
|
||||||
QvMessageBoxWarn(nullptr, deepinWarnTitle, deepinWarnMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
// set them back! - NOPE. setenv only works within your little program.
|
|
||||||
// const auto httpProxyURL = QString("http://%1:%2").arg(address, QSTRN(httpPort)).toStdString();
|
|
||||||
// setenv("https_proxy", httpProxyURL.c_str(), true);
|
|
||||||
// setenv("ftp_proxy", httpProxyURL.c_str(), true);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
for (const auto &service : macOSgetNetworkServices())
|
for (const auto &service : macOSgetNetworkServices())
|
||||||
|
Loading…
Reference in New Issue
Block a user