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:
DuckSoft 2020-10-23 06:06:00 +08:00 committed by QxQ
parent e1a9cf4029
commit 054c3c0695
2 changed files with 0 additions and 22 deletions

View File

@ -8,7 +8,6 @@ namespace Qv2ray::base
struct Qv2rayRuntimeConfig
{
bool screenShotHideQv2ray = false;
bool deepinHorribleProxyHint = false;
};
inline base::Qv2rayRuntimeConfig RuntimeConfig = base::Qv2rayRuntimeConfig();
} // namespace Qv2ray::base

View File

@ -237,7 +237,6 @@ namespace Qv2ray::components::proxy
actions << ProcessArgument{ "gsettings", { "set", "org.gnome.system.proxy", "mode", "manual" } };
//
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);
//
@ -328,26 +327,6 @@ namespace Qv2ray::components::proxy
{
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
for (const auto &service : macOSgetNetworkServices())