fix: changed inline code block settings

This commit is contained in:
Qv2ray-dev 2020-03-01 17:24:58 +08:00
parent 56f0886afd
commit 46c13543a4
17 changed files with 96 additions and 29 deletions

View File

@ -5,7 +5,7 @@ AlignAfterOpenBracket: Align
AllowAllArgumentsOnNextLine: 'false'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'true'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'

View File

@ -1 +1 @@
4211
4215

View File

@ -118,7 +118,10 @@ namespace Qv2ray::common
{
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;
}

View File

@ -50,7 +50,10 @@ namespace Qv2ray::components::pac
if (originLine[startPosition] == '\n')
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;

View File

@ -191,7 +191,10 @@ void SpeedPlotView::pushPoint(const SpeedPlotView::PointData &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()

View File

@ -53,7 +53,10 @@ namespace Qv2ray::core
{
QList<IDType> list;
for (auto str : strings) { list << IDType(str); }
for (auto str : strings)
{
list << IDType(str);
}
return list;
}
@ -63,7 +66,10 @@ namespace Qv2ray::core
{
QList<QString> list;
for (auto id : ids) { list << id.toString(); }
for (auto id : ids)
{
list << id.toString();
}
return list;
}

View File

@ -266,7 +266,10 @@ namespace Qv2ray
{
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;
}

View File

@ -420,7 +420,10 @@ namespace Qv2ray::core::connection
else if (net == "http" || net == "h2")
{
// 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;
}

View File

@ -29,7 +29,10 @@ namespace Qv2ray::core::handlers
auto val = GlobalConfig.subscriptions[key];
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())
@ -43,7 +46,10 @@ namespace Qv2ray::core::handlers
auto val = GlobalConfig.groups[key];
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();
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++)
{
@ -122,12 +130,18 @@ namespace Qv2ray::core::handlers
void QvConnectionHandler::StartLatencyTest()
{
for (auto connection : connections.keys()) { StartLatencyTest(connection); }
for (auto connection : connections.keys())
{
StartLatencyTest(connection);
}
}
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)
@ -302,7 +316,10 @@ namespace Qv2ray::core::handlers
// Copy construct
auto list = groups[id].connections;
for (auto conn : list) { MoveConnectionGroup(conn, DefaultGroupId); }
for (auto conn : list)
{
MoveConnectionGroup(conn, DefaultGroupId);
}
//
if (groups[id].isSubscription)
{

View File

@ -361,7 +361,10 @@ int main(int argc, char *argv[])
}
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.

View File

@ -144,7 +144,9 @@ void InboundEditor::LoadUIData()
httpAccountListBox->clear();
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
socksAuthCombo->setCurrentText(socksSettings["auth"].toString());
@ -153,7 +155,9 @@ void InboundEditor::LoadUIData()
socksUserLevelSB->setValue(socksSettings["userLevel"].toInt());
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
dokoFollowRedirectCB->setChecked(dokoSettings["followRedirect"].toBool());

View File

@ -446,7 +446,10 @@ void RouteEditor::ShowCurrentRuleDetail()
balancerSelectionCombo->clear();
// 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.
@ -726,7 +729,10 @@ void RouteEditor::on_addOutboundBtn_clicked()
// conf is rootObject, needs to unwrap it.
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

View File

@ -1,4 +1,5 @@
#include "w_ExportConfig.hpp"
#include "common/QvHelpers.hpp"
#include "core/connection/Serialization.hpp"

View File

@ -924,6 +924,9 @@ void MainWindow::OnGroupCreated(const GroupId &id, const QString &displayName)
}
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);
}

View File

@ -43,7 +43,10 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent), Current
languageComboBox->clear();
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
SetAutoStartButtonsState(GetLaunchAtLoginStatus());
@ -162,11 +165,17 @@ PreferencesWindow::PreferencesWindow(QWidget *parent) : QDialog(parent), Current
auto autoStartConnId = ConnectionId(CurrentConfig.autoStartId);
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));
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));
@ -1011,7 +1020,10 @@ void PreferencesWindow::on_autoStartSubsCombo_currentIndexChanged(const QString
auto list = ConnectionManager->Connections(groupId);
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)

View File

@ -13,9 +13,7 @@ SubscribeEditor::SubscribeEditor(QWidget *parent) : QDialog(parent)
for (auto subs : ConnectionManager->Subscriptions())
{
subscriptionList->addTopLevelItem(new QTreeWidgetItem(QStringList() //
<< ConnectionManager->GetDisplayName(subs) //
<< subs.toString())); //
subscriptionList->addTopLevelItem(new QTreeWidgetItem(QStringList{ ConnectionManager->GetDisplayName(subs), subs.toString() })); //
}
}

View File

@ -35,7 +35,9 @@ void StreamSettingsWidget::SetStreamObject(StreamSettingsObject sso)
QString wsHeaders;
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);
// mKCP