mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 02:40:20 +08:00
fix: changed inline code block settings
This commit is contained in:
parent
56f0886afd
commit
46c13543a4
@ -5,7 +5,7 @@ AlignAfterOpenBracket: Align
|
|||||||
AllowAllArgumentsOnNextLine: 'false'
|
AllowAllArgumentsOnNextLine: 'false'
|
||||||
AllowAllConstructorInitializersOnNextLine: 'false'
|
AllowAllConstructorInitializersOnNextLine: 'false'
|
||||||
AllowAllParametersOfDeclarationOnNextLine: 'false'
|
AllowAllParametersOfDeclarationOnNextLine: 'false'
|
||||||
AllowShortBlocksOnASingleLine: 'true'
|
AllowShortBlocksOnASingleLine: 'false'
|
||||||
AllowShortCaseLabelsOnASingleLine: 'true'
|
AllowShortCaseLabelsOnASingleLine: 'true'
|
||||||
AllowShortFunctionsOnASingleLine: None
|
AllowShortFunctionsOnASingleLine: None
|
||||||
AllowShortIfStatementsOnASingleLine: 'false'
|
AllowShortIfStatementsOnASingleLine: 'false'
|
||||||
|
@ -1 +1 @@
|
|||||||
4211
|
4215
|
||||||
|
@ -118,7 +118,10 @@ namespace Qv2ray::common
|
|||||||
{
|
{
|
||||||
list<string> list;
|
list<string> list;
|
||||||
|
|
||||||
for (auto line : _string.split(QRegExp("[\r\n]"), QString::SkipEmptyParts)) { list.push_back(line.toStdString()); }
|
for (auto line : _string.split(QRegExp("[\r\n]"), QString::SkipEmptyParts))
|
||||||
|
{
|
||||||
|
list.push_back(line.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,10 @@ namespace Qv2ray::components::pac
|
|||||||
if (originLine[startPosition] == '\n')
|
if (originLine[startPosition] == '\n')
|
||||||
startPosition += 1;
|
startPosition += 1;
|
||||||
|
|
||||||
for (size_t i = startPosition; i < endPosition; ++i) { returnBuffer += originLine[i]; }
|
for (size_t i = startPosition; i < endPosition; ++i)
|
||||||
|
{
|
||||||
|
returnBuffer += originLine[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnBuffer;
|
return returnBuffer;
|
||||||
|
@ -191,7 +191,10 @@ void SpeedPlotView::pushPoint(const SpeedPlotView::PointData &point)
|
|||||||
{
|
{
|
||||||
m_datahalfMin.push_back(point);
|
m_datahalfMin.push_back(point);
|
||||||
|
|
||||||
while (m_datahalfMin.length() > VIEWABLE) { m_datahalfMin.removeFirst(); }
|
while (m_datahalfMin.length() > VIEWABLE)
|
||||||
|
{
|
||||||
|
m_datahalfMin.removeFirst();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeedPlotView::replot()
|
void SpeedPlotView::replot()
|
||||||
|
@ -53,7 +53,10 @@ namespace Qv2ray::core
|
|||||||
{
|
{
|
||||||
QList<IDType> list;
|
QList<IDType> list;
|
||||||
|
|
||||||
for (auto str : strings) { list << IDType(str); }
|
for (auto str : strings)
|
||||||
|
{
|
||||||
|
list << IDType(str);
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -63,7 +66,10 @@ namespace Qv2ray::core
|
|||||||
{
|
{
|
||||||
QList<QString> list;
|
QList<QString> list;
|
||||||
|
|
||||||
for (auto id : ids) { list << id.toString(); }
|
for (auto id : ids)
|
||||||
|
{
|
||||||
|
list << id.toString();
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,10 @@ namespace Qv2ray
|
|||||||
{
|
{
|
||||||
LOG(MODULE_SETTINGS, "Migrating config from version " + QSTRN(fromVersion) + " to " + QSTRN(toVersion))
|
LOG(MODULE_SETTINGS, "Migrating config from version " + QSTRN(fromVersion) + " to " + QSTRN(toVersion))
|
||||||
|
|
||||||
for (int i = fromVersion; i < toVersion; i++) { root = UpgradeConfig_Inc(i, root); }
|
for (int i = fromVersion; i < toVersion; i++)
|
||||||
|
{
|
||||||
|
root = UpgradeConfig_Inc(i, root);
|
||||||
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,10 @@ namespace Qv2ray::core::connection
|
|||||||
else if (net == "http" || net == "h2")
|
else if (net == "http" || net == "h2")
|
||||||
{
|
{
|
||||||
// Fill hosts for HTTP
|
// Fill hosts for HTTP
|
||||||
for (auto _host : host.split(',')) { streaming.httpSettings.host.push_back(_host.trimmed()); }
|
for (auto _host : host.split(','))
|
||||||
|
{
|
||||||
|
streaming.httpSettings.host.push_back(_host.trimmed());
|
||||||
|
}
|
||||||
|
|
||||||
streaming.httpSettings.path = path;
|
streaming.httpSettings.path = path;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,10 @@ namespace Qv2ray::core::handlers
|
|||||||
auto val = GlobalConfig.subscriptions[key];
|
auto val = GlobalConfig.subscriptions[key];
|
||||||
groups[gkey] = val;
|
groups[gkey] = val;
|
||||||
|
|
||||||
for (auto conn : val.connections) { connections[ConnectionId(conn)].groupId = GroupId(key); }
|
for (auto conn : val.connections)
|
||||||
|
{
|
||||||
|
connections[ConnectionId(conn)].groupId = GroupId(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto key : GlobalConfig.groups.keys())
|
for (auto key : GlobalConfig.groups.keys())
|
||||||
@ -43,7 +46,10 @@ namespace Qv2ray::core::handlers
|
|||||||
auto val = GlobalConfig.groups[key];
|
auto val = GlobalConfig.groups[key];
|
||||||
groups[gkey] = val;
|
groups[gkey] = val;
|
||||||
|
|
||||||
for (auto conn : val.connections) { connections[ConnectionId(conn)].groupId = GroupId(key); }
|
for (auto conn : val.connections)
|
||||||
|
{
|
||||||
|
connections[ConnectionId(conn)].groupId = GroupId(key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -78,7 +84,9 @@ namespace Qv2ray::core::handlers
|
|||||||
newGlobalConfig.subscriptions.clear();
|
newGlobalConfig.subscriptions.clear();
|
||||||
|
|
||||||
for (auto i = 0; i < connections.count(); i++)
|
for (auto i = 0; i < connections.count(); i++)
|
||||||
{ newGlobalConfig.connections[connections.keys()[i].toString()] = connections.values()[i]; }
|
{
|
||||||
|
newGlobalConfig.connections[connections.keys()[i].toString()] = connections.values()[i];
|
||||||
|
}
|
||||||
|
|
||||||
for (auto i = 0; i < groups.count(); i++)
|
for (auto i = 0; i < groups.count(); i++)
|
||||||
{
|
{
|
||||||
@ -122,12 +130,18 @@ namespace Qv2ray::core::handlers
|
|||||||
|
|
||||||
void QvConnectionHandler::StartLatencyTest()
|
void QvConnectionHandler::StartLatencyTest()
|
||||||
{
|
{
|
||||||
for (auto connection : connections.keys()) { StartLatencyTest(connection); }
|
for (auto connection : connections.keys())
|
||||||
|
{
|
||||||
|
StartLatencyTest(connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QvConnectionHandler::StartLatencyTest(const GroupId &id)
|
void QvConnectionHandler::StartLatencyTest(const GroupId &id)
|
||||||
{
|
{
|
||||||
for (auto connection : groups[id].connections) { StartLatencyTest(connection); }
|
for (auto connection : groups[id].connections)
|
||||||
|
{
|
||||||
|
StartLatencyTest(connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QvConnectionHandler::StartLatencyTest(const ConnectionId &id)
|
void QvConnectionHandler::StartLatencyTest(const ConnectionId &id)
|
||||||
@ -302,7 +316,10 @@ namespace Qv2ray::core::handlers
|
|||||||
|
|
||||||
// Copy construct
|
// Copy construct
|
||||||
auto list = groups[id].connections;
|
auto list = groups[id].connections;
|
||||||
for (auto conn : list) { MoveConnectionGroup(conn, DefaultGroupId); }
|
for (auto conn : list)
|
||||||
|
{
|
||||||
|
MoveConnectionGroup(conn, DefaultGroupId);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
if (groups[id].isSubscription)
|
if (groups[id].isSubscription)
|
||||||
{
|
{
|
||||||
|
@ -361,7 +361,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (auto lang : langs) { LOG(MODULE_INIT, "Found Translator: " + lang) }
|
for (auto lang : langs)
|
||||||
|
{
|
||||||
|
LOG(MODULE_INIT, "Found Translator: " + lang)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Qv2ray Initialize, find possible config paths and verify them.
|
// Qv2ray Initialize, find possible config paths and verify them.
|
||||||
|
@ -144,7 +144,9 @@ void InboundEditor::LoadUIData()
|
|||||||
httpAccountListBox->clear();
|
httpAccountListBox->clear();
|
||||||
|
|
||||||
for (auto user : httpSettings["accounts"].toArray())
|
for (auto user : httpSettings["accounts"].toArray())
|
||||||
{ httpAccountListBox->addItem(user.toObject()["user"].toString() + ":" + user.toObject()["pass"].toString()); }
|
{
|
||||||
|
httpAccountListBox->addItem(user.toObject()["user"].toString() + ":" + user.toObject()["pass"].toString());
|
||||||
|
}
|
||||||
|
|
||||||
// SOCKS
|
// SOCKS
|
||||||
socksAuthCombo->setCurrentText(socksSettings["auth"].toString());
|
socksAuthCombo->setCurrentText(socksSettings["auth"].toString());
|
||||||
@ -153,7 +155,9 @@ void InboundEditor::LoadUIData()
|
|||||||
socksUserLevelSB->setValue(socksSettings["userLevel"].toInt());
|
socksUserLevelSB->setValue(socksSettings["userLevel"].toInt());
|
||||||
|
|
||||||
for (auto user : socksSettings["accounts"].toArray())
|
for (auto user : socksSettings["accounts"].toArray())
|
||||||
{ socksAccountListBox->addItem(user.toObject()["user"].toString() + ":" + user.toObject()["pass"].toString()); }
|
{
|
||||||
|
socksAccountListBox->addItem(user.toObject()["user"].toString() + ":" + user.toObject()["pass"].toString());
|
||||||
|
}
|
||||||
|
|
||||||
// Dokodemo-Door
|
// Dokodemo-Door
|
||||||
dokoFollowRedirectCB->setChecked(dokoSettings["followRedirect"].toBool());
|
dokoFollowRedirectCB->setChecked(dokoSettings["followRedirect"].toBool());
|
||||||
|
@ -446,7 +446,10 @@ void RouteEditor::ShowCurrentRuleDetail()
|
|||||||
balancerSelectionCombo->clear();
|
balancerSelectionCombo->clear();
|
||||||
|
|
||||||
// BUG added the wrong items, should be outbound list.
|
// BUG added the wrong items, should be outbound list.
|
||||||
for (auto out : outbounds) { balancerSelectionCombo->addItem((out)["tag"].toString()); }
|
for (auto out : outbounds)
|
||||||
|
{
|
||||||
|
balancerSelectionCombo->addItem((out)["tag"].toString());
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Balancers combo and balancer list.
|
// Balancers combo and balancer list.
|
||||||
@ -726,7 +729,10 @@ void RouteEditor::on_addOutboundBtn_clicked()
|
|||||||
// conf is rootObject, needs to unwrap it.
|
// conf is rootObject, needs to unwrap it.
|
||||||
auto confList = conf["outbounds"].toArray();
|
auto confList = conf["outbounds"].toArray();
|
||||||
|
|
||||||
for (int i = 0; i < confList.count(); i++) { AddOutbound(OUTBOUND(confList[i].toObject())); }
|
for (int i = 0; i < confList.count(); i++)
|
||||||
|
{
|
||||||
|
AddOutbound(OUTBOUND(confList[i].toObject()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECKEMPTYRULES
|
CHECKEMPTYRULES
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include "w_ExportConfig.hpp"
|
#include "w_ExportConfig.hpp"
|
||||||
|
|
||||||
#include "common/QvHelpers.hpp"
|
#include "common/QvHelpers.hpp"
|
||||||
#include "core/connection/Serialization.hpp"
|
#include "core/connection/Serialization.hpp"
|
||||||
|
|
||||||
|
@ -924,6 +924,9 @@ void MainWindow::OnGroupCreated(const GroupId &id, const QString &displayName)
|
|||||||
}
|
}
|
||||||
void MainWindow::OnGroupDeleted(const GroupId &id, const QList<ConnectionId> &connections)
|
void MainWindow::OnGroupDeleted(const GroupId &id, const QList<ConnectionId> &connections)
|
||||||
{
|
{
|
||||||
for (auto conn : connections) { groupNodes[id]->removeChild(connectionNodes[conn].get()); }
|
for (auto conn : connections)
|
||||||
|
{
|
||||||
|
groupNodes[id]->removeChild(connectionNodes[conn].get());
|
||||||
|
}
|
||||||
groupNodes.remove(id);
|
groupNodes.remove(id);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,10 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent), Current
|
|||||||
languageComboBox->clear();
|
languageComboBox->clear();
|
||||||
QDirIterator it(":/translations");
|
QDirIterator it(":/translations");
|
||||||
|
|
||||||
while (it.hasNext()) { languageComboBox->addItem(it.next().split("/").last().split(".").first()); }
|
while (it.hasNext())
|
||||||
|
{
|
||||||
|
languageComboBox->addItem(it.next().split("/").last().split(".").first());
|
||||||
|
}
|
||||||
|
|
||||||
// Set auto start button state
|
// Set auto start button state
|
||||||
SetAutoStartButtonsState(GetLaunchAtLoginStatus());
|
SetAutoStartButtonsState(GetLaunchAtLoginStatus());
|
||||||
@ -162,11 +165,17 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent), Current
|
|||||||
auto autoStartConnId = ConnectionId(CurrentConfig.autoStartId);
|
auto autoStartConnId = ConnectionId(CurrentConfig.autoStartId);
|
||||||
auto autoStartGroupId = ConnectionManager->GetConnectionGroupId(autoStartConnId);
|
auto autoStartGroupId = ConnectionManager->GetConnectionGroupId(autoStartConnId);
|
||||||
|
|
||||||
for (auto group : ConnectionManager->AllGroups()) { autoStartSubsCombo->addItem(ConnectionManager->GetDisplayName(group)); }
|
for (auto group : ConnectionManager->AllGroups())
|
||||||
|
{
|
||||||
|
autoStartSubsCombo->addItem(ConnectionManager->GetDisplayName(group));
|
||||||
|
}
|
||||||
|
|
||||||
autoStartSubsCombo->setCurrentText(ConnectionManager->GetDisplayName(autoStartGroupId));
|
autoStartSubsCombo->setCurrentText(ConnectionManager->GetDisplayName(autoStartGroupId));
|
||||||
|
|
||||||
for (auto conn : ConnectionManager->Connections(autoStartGroupId)) { autoStartConnCombo->addItem(ConnectionManager->GetDisplayName(conn)); }
|
for (auto conn : ConnectionManager->Connections(autoStartGroupId))
|
||||||
|
{
|
||||||
|
autoStartConnCombo->addItem(ConnectionManager->GetDisplayName(conn));
|
||||||
|
}
|
||||||
|
|
||||||
autoStartConnCombo->setCurrentText(ConnectionManager->GetDisplayName(autoStartConnId));
|
autoStartConnCombo->setCurrentText(ConnectionManager->GetDisplayName(autoStartConnId));
|
||||||
|
|
||||||
@ -1011,7 +1020,10 @@ void PreferencesWindow::on_autoStartSubsCombo_currentIndexChanged(const QString
|
|||||||
auto list = ConnectionManager->Connections(groupId);
|
auto list = ConnectionManager->Connections(groupId);
|
||||||
autoStartConnCombo->clear();
|
autoStartConnCombo->clear();
|
||||||
|
|
||||||
for (auto id : list) { autoStartConnCombo->addItem(ConnectionManager->GetDisplayName(id)); }
|
for (auto id : list)
|
||||||
|
{
|
||||||
|
autoStartConnCombo->addItem(ConnectionManager->GetDisplayName(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreferencesWindow::on_autoStartConnCombo_currentIndexChanged(const QString &arg1)
|
void PreferencesWindow::on_autoStartConnCombo_currentIndexChanged(const QString &arg1)
|
||||||
|
@ -13,9 +13,7 @@ SubscribeEditor::SubscribeEditor(QWidget *parent) : QDialog(parent)
|
|||||||
|
|
||||||
for (auto subs : ConnectionManager->Subscriptions())
|
for (auto subs : ConnectionManager->Subscriptions())
|
||||||
{
|
{
|
||||||
subscriptionList->addTopLevelItem(new QTreeWidgetItem(QStringList() //
|
subscriptionList->addTopLevelItem(new QTreeWidgetItem(QStringList{ ConnectionManager->GetDisplayName(subs), subs.toString() })); //
|
||||||
<< ConnectionManager->GetDisplayName(subs) //
|
|
||||||
<< subs.toString())); //
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,9 @@ void StreamSettingsWidget::SetStreamObject(StreamSettingsObject sso)
|
|||||||
QString wsHeaders;
|
QString wsHeaders;
|
||||||
|
|
||||||
for (auto item = stream.wsSettings.headers.begin(); item != stream.wsSettings.headers.end(); item++)
|
for (auto item = stream.wsSettings.headers.begin(); item != stream.wsSettings.headers.end(); item++)
|
||||||
{ wsHeaders += item.key() + "|" + item.value() + NEWLINE; }
|
{
|
||||||
|
wsHeaders += item.key() + "|" + item.value() + NEWLINE;
|
||||||
|
}
|
||||||
|
|
||||||
wsHeadersTxt->setPlainText(wsHeaders);
|
wsHeadersTxt->setPlainText(wsHeaders);
|
||||||
// mKCP
|
// mKCP
|
||||||
|
Loading…
Reference in New Issue
Block a user