mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-18 09:50:38 +08:00
fix: fixed warnings and added pre-commit hook
This commit is contained in:
parent
cb9ea94f14
commit
b51fa558a1
12
hooks/pre-commit
Executable file
12
hooks/pre-commit
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
STAGE_FILES=$(git diff --cached --name-only --diff-filter=ACM -- 'makespec/BUILDVERSION')
|
||||||
|
#echo $STAGE_FILES
|
||||||
|
if test ${#STAGE_FILES} -gt 0
|
||||||
|
then
|
||||||
|
echo 'BUILDVERSION already changed, not touching'
|
||||||
|
else
|
||||||
|
echo 'Increasing BUILDVERSION'
|
||||||
|
expr $(cat ./makespec/BUILDVERSION) + 1 > ./makespec/BUILDVERSION
|
||||||
|
cat ./makespec/BUILDVERSION
|
||||||
|
git add ./makespec/BUILDVERSION
|
||||||
|
fi
|
@ -1 +1 @@
|
|||||||
5380
|
5384
|
||||||
|
@ -56,7 +56,7 @@ namespace Qv2ray::common
|
|||||||
}
|
}
|
||||||
|
|
||||||
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
|
||||||
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true);
|
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true);
|
||||||
auto ua = GlobalConfig.networkConfig.userAgent;
|
auto ua = GlobalConfig.networkConfig.userAgent;
|
||||||
ua.replace("$VERSION", QV2RAY_VERSION_STRING);
|
ua.replace("$VERSION", QV2RAY_VERSION_STRING);
|
||||||
request.setHeader(QNetworkRequest::KnownHeaders::UserAgentHeader, ua);
|
request.setHeader(QNetworkRequest::KnownHeaders::UserAgentHeader, ua);
|
||||||
@ -88,7 +88,7 @@ namespace Qv2ray::common
|
|||||||
|
|
||||||
void QvHttpRequestHelper::onRequestFinished_p()
|
void QvHttpRequestHelper::onRequestFinished_p()
|
||||||
{
|
{
|
||||||
if (reply->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool())
|
if (reply->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool())
|
||||||
{
|
{
|
||||||
DEBUG(MODULE_NETWORK, "HTTP/2 was used.")
|
DEBUG(MODULE_NETWORK, "HTTP/2 was used.")
|
||||||
}
|
}
|
||||||
|
@ -184,16 +184,16 @@ namespace Qv2ray::components::autolaunch
|
|||||||
|
|
||||||
QTextStream ts(&iniFile);
|
QTextStream ts(&iniFile);
|
||||||
ts.setCodec("UTF-8");
|
ts.setCodec("UTF-8");
|
||||||
ts << QLatin1String("[Desktop Entry]") << endl
|
ts << QLatin1String("[Desktop Entry]") << Qt::endl
|
||||||
<< QLatin1String("Name=") << QApplication::applicationName() << endl
|
<< QLatin1String("Name=") << QApplication::applicationName() + QApplication::arguments().join(" ") << Qt::endl
|
||||||
<< QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << endl
|
<< QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << Qt::endl
|
||||||
<< QLatin1String("Exec=") << binPath << endl
|
<< QLatin1String("Exec=") << binPath << Qt::endl
|
||||||
<< QLatin1String("Terminal=") << "false" << endl
|
<< QLatin1String("Terminal=") << "false" << Qt::endl
|
||||||
<< QLatin1String("Icon=") << "qv2ray" << endl // always use lowercase for icons
|
<< QLatin1String("Icon=") << "qv2ray" << Qt::endl // always use lowercase for icons
|
||||||
<< QLatin1String("Categories=") << "Network" << endl
|
<< QLatin1String("Categories=") << "Network" << Qt::endl
|
||||||
<< QLatin1String("Type=") << "Application" << endl
|
<< QLatin1String("Type=") << "Application" << Qt::endl
|
||||||
<< QLatin1String("StartupNotify=") << "false" << endl
|
<< QLatin1String("StartupNotify=") << "false" << Qt::endl
|
||||||
<< QLatin1String("X-GNOME-Autostart-enabled=") << "true" << endl;
|
<< QLatin1String("X-GNOME-Autostart-enabled=") << "true" << Qt::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@ namespace Qv2ray::core::connection::Serialization
|
|||||||
OUTBOUNDS outbounds;
|
OUTBOUNDS outbounds;
|
||||||
outbounds.append(GenerateOutboundEntry("shadowsocks", GenerateShadowSocksOUT({ ssObject }), {}));
|
outbounds.append(GenerateOutboundEntry("shadowsocks", GenerateShadowSocksOUT({ ssObject }), {}));
|
||||||
JADD(outbounds)
|
JADD(outbounds)
|
||||||
serverList.insertMulti(totalName, root);
|
serverList.insert(totalName, root);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns the current result
|
// returns the current result
|
||||||
|
Loading…
Reference in New Issue
Block a user