diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 00000000..a7d0ad5c --- /dev/null +++ b/hooks/pre-commit @@ -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 diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index a1003e33..70bea13d 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5380 +5384 diff --git a/src/common/HTTPRequestHelper.cpp b/src/common/HTTPRequestHelper.cpp index 7295b2d2..8c8648bc 100644 --- a/src/common/HTTPRequestHelper.cpp +++ b/src/common/HTTPRequestHelper.cpp @@ -56,7 +56,7 @@ namespace Qv2ray::common } request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy); - request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true); + request.setAttribute(QNetworkRequest::Http2AllowedAttribute, true); auto ua = GlobalConfig.networkConfig.userAgent; ua.replace("$VERSION", QV2RAY_VERSION_STRING); request.setHeader(QNetworkRequest::KnownHeaders::UserAgentHeader, ua); @@ -88,7 +88,7 @@ namespace Qv2ray::common void QvHttpRequestHelper::onRequestFinished_p() { - if (reply->attribute(QNetworkRequest::HTTP2WasUsedAttribute).toBool()) + if (reply->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool()) { DEBUG(MODULE_NETWORK, "HTTP/2 was used.") } diff --git a/src/components/autolaunch/QvAutoLaunch.cpp b/src/components/autolaunch/QvAutoLaunch.cpp index cdf2f006..3390bccb 100644 --- a/src/components/autolaunch/QvAutoLaunch.cpp +++ b/src/components/autolaunch/QvAutoLaunch.cpp @@ -184,16 +184,16 @@ namespace Qv2ray::components::autolaunch QTextStream ts(&iniFile); ts.setCodec("UTF-8"); - ts << QLatin1String("[Desktop Entry]") << endl - << QLatin1String("Name=") << QApplication::applicationName() << endl - << QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << endl - << QLatin1String("Exec=") << binPath << endl - << QLatin1String("Terminal=") << "false" << endl - << QLatin1String("Icon=") << "qv2ray" << endl // always use lowercase for icons - << QLatin1String("Categories=") << "Network" << endl - << QLatin1String("Type=") << "Application" << endl - << QLatin1String("StartupNotify=") << "false" << endl - << QLatin1String("X-GNOME-Autostart-enabled=") << "true" << endl; + ts << QLatin1String("[Desktop Entry]") << Qt::endl + << QLatin1String("Name=") << QApplication::applicationName() + QApplication::arguments().join(" ") << Qt::endl + << QLatin1String("GenericName=") << QLatin1String("V2ray Frontend") << Qt::endl + << QLatin1String("Exec=") << binPath << Qt::endl + << QLatin1String("Terminal=") << "false" << Qt::endl + << QLatin1String("Icon=") << "qv2ray" << Qt::endl // always use lowercase for icons + << QLatin1String("Categories=") << "Network" << Qt::endl + << QLatin1String("Type=") << "Application" << Qt::endl + << QLatin1String("StartupNotify=") << "false" << Qt::endl + << QLatin1String("X-GNOME-Autostart-enabled=") << "true" << Qt::endl; } else { diff --git a/src/core/connection/Serialization_ssd.cpp b/src/core/connection/Serialization_ssd.cpp index 6d2c9622..17f6e541 100644 --- a/src/core/connection/Serialization_ssd.cpp +++ b/src/core/connection/Serialization_ssd.cpp @@ -209,7 +209,7 @@ namespace Qv2ray::core::connection::Serialization OUTBOUNDS outbounds; outbounds.append(GenerateOutboundEntry("shadowsocks", GenerateShadowSocksOUT({ ssObject }), {})); JADD(outbounds) - serverList.insertMulti(totalName, root); + serverList.insert(totalName, root); } // returns the current result