mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
refactor: rearranged header include
This commit is contained in:
parent
2d4d41468f
commit
c55d60ab21
@ -172,7 +172,6 @@ set(QV2RAY_SOURCES_NO_MAIN
|
||||
src/core/connection/ConnectionIO.hpp
|
||||
src/core/connection/Generation.hpp
|
||||
src/core/connection/Serialization.hpp
|
||||
src/core/CoreSafeTypes.hpp
|
||||
src/core/CoreUtils.hpp
|
||||
src/core/handler/ConfigHandler.hpp
|
||||
src/core/handler/KernelInstanceHandler.hpp
|
||||
|
@ -1 +1 @@
|
||||
5444
|
||||
5445
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
|
||||
namespace Qv2ray::components::tcping
|
||||
{
|
||||
|
@ -1,25 +0,0 @@
|
||||
//#pragma once
|
||||
//#include "base/models/QvConfigIdentifier.hpp"
|
||||
|
||||
////#include <QString>
|
||||
|
||||
//// namespace Qv2ray::core
|
||||
////{
|
||||
//// template<typename IDType>
|
||||
//// QList<IDType> StringsToIdList(const QList<QString> &strings)
|
||||
//// {
|
||||
//// QList<IDType> list;
|
||||
//// for (const auto &str : strings) list << IDType(str);
|
||||
//// return list;
|
||||
//// }
|
||||
|
||||
//// template<typename IDType>
|
||||
//// QList<QString> IdListToStrings(const QList<IDType> &ids)
|
||||
//// {
|
||||
//// QList<QString> list;
|
||||
//// for (const auto &id : ids) list << id.toString();
|
||||
//// return list;
|
||||
//// }
|
||||
////} // namespace Qv2ray::core
|
||||
|
||||
//// using namespace Qv2ray::core;
|
@ -1,10 +1,7 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "base/models/CoreObjectModels.hpp"
|
||||
#include "base/models/QvConfigIdentifier.hpp"
|
||||
#include "base/models/QvSafeType.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace Qv2ray::core
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
namespace Qv2ray::core::connection
|
||||
{
|
||||
namespace ConnectionIO
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
|
||||
namespace Qv2ray::core::connection
|
||||
{
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "common/HTTPRequestHelper.hpp"
|
||||
#include "components/latency/QvTCPing.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
#include "core/CoreUtils.hpp"
|
||||
#include "core/connection/ConnectionIO.hpp"
|
||||
#include "core/handler/KernelInstanceHandler.hpp"
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "components/plugins/QvPluginHost.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
#include "core/kernel/V2rayKernelInteractions.hpp"
|
||||
|
||||
#include <QObject>
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
#include "core/kernel/QvKernelABIChecker.hpp"
|
||||
|
||||
#include <QProcess>
|
||||
|
@ -1,11 +1,10 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_w_InboundEditor.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QJsonObject>
|
||||
#include <QListWidgetItem>
|
||||
|
||||
class InboundEditor
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "ui_w_JsonEditor.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtCore>
|
||||
|
||||
class JsonEditor
|
||||
: public QDialog
|
||||
|
@ -1,9 +1,8 @@
|
||||
#include "w_OutboundEditor.hpp"
|
||||
#include "w_OutboundEditor.hpp"
|
||||
|
||||
#include "core/connection/Generation.hpp"
|
||||
#include "ui/editors/w_JsonEditor.hpp"
|
||||
#include "ui/editors/w_RoutesEditor.hpp"
|
||||
#include "ui/w_MainWindow.hpp"
|
||||
|
||||
#include <QFile>
|
||||
#include <QIntValidator>
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "core/CoreSafeTypes.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_w_GroupManager.h"
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_w_ImportConfig.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
|
||||
class ImportConfigWindow
|
||||
: public QDialog
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "components/plugins/QvPluginHost.hpp"
|
||||
#include "components/proxy/QvProxyConfigurator.hpp"
|
||||
#include "components/update/UpdateChecker.hpp"
|
||||
#include "core/handler/ConfigHandler.hpp"
|
||||
#include "core/settings/SettingsBackend.hpp"
|
||||
#include "ui/editors/w_JsonEditor.hpp"
|
||||
#include "ui/editors/w_OutboundEditor.hpp"
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "common/HTTPRequestHelper.hpp"
|
||||
#include "common/LogHighlighter.hpp"
|
||||
#include "components/speedchart/speedwidget.hpp"
|
||||
#include "core/handler/ConfigHandler.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_w_MainWindow.h"
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_w_PreferencesWindow.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <ui_w_PreferencesWindow.h>
|
||||
|
||||
class RouteSettingsMatrixWidget;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "ConnectionItemWidget.hpp"
|
||||
|
||||
#include "common/QvHelpers.hpp"
|
||||
#include "core/handler/ConfigHandler.hpp"
|
||||
|
||||
#include <QStyleFactory>
|
||||
|
||||
@ -89,6 +90,27 @@ void ConnectionItemWidget::BeginConnection()
|
||||
}
|
||||
}
|
||||
|
||||
bool ConnectionItemWidget::NameMatched(const QString &arg) const
|
||||
{
|
||||
auto searchString = arg.toLower();
|
||||
auto headerMatched = GetDisplayName(groupId).toLower().contains(arg);
|
||||
|
||||
if (itemType != NODE_ITEM)
|
||||
{
|
||||
return headerMatched;
|
||||
}
|
||||
else
|
||||
{
|
||||
return headerMatched || GetDisplayName(connectionId).toLower().contains(searchString);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionItemWidget::RecalculateConnectionsCount()
|
||||
{
|
||||
auto connectionCount = ConnectionManager->Connections(groupId).count();
|
||||
latencyLabel->setText(QSTRN(connectionCount) + " " + (connectionCount < 2 ? tr("connection") : tr("connections")));
|
||||
}
|
||||
|
||||
void ConnectionItemWidget::OnConnected(const ConnectionGroupPair &id)
|
||||
{
|
||||
if (id == ConnectionGroupPair{ connectionId, groupId })
|
||||
|
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "core/handler/ConfigHandler.hpp"
|
||||
#include "base/models/QvConfigIdentifier.hpp"
|
||||
#include "ui_ConnectionItemWidget.h"
|
||||
|
||||
#include <QWidget>
|
||||
@ -25,26 +25,10 @@ class ConnectionItemWidget
|
||||
//
|
||||
void BeginRename();
|
||||
void CancelRename();
|
||||
inline bool NameMatched(const QString &arg)
|
||||
{
|
||||
auto searchString = arg.toLower();
|
||||
auto headerMatched = GetDisplayName(groupId).toLower().contains(arg);
|
||||
|
||||
if (itemType != NODE_ITEM)
|
||||
{
|
||||
return headerMatched;
|
||||
}
|
||||
else
|
||||
{
|
||||
return headerMatched || GetDisplayName(connectionId).toLower().contains(searchString);
|
||||
}
|
||||
}
|
||||
bool NameMatched(const QString &arg) const;
|
||||
inline const ConnectionGroupPair Identifier() const
|
||||
{
|
||||
ConnectionGroupPair i;
|
||||
i.connectionId = this->connectionId;
|
||||
i.groupId = this->groupId;
|
||||
return i;
|
||||
return { this->connectionId, this->groupId };
|
||||
}
|
||||
inline bool IsRenaming() const
|
||||
{
|
||||
@ -63,11 +47,7 @@ class ConnectionItemWidget
|
||||
void OnLatencyTestStart(const ConnectionId &id);
|
||||
void OnConnectionModified(const ConnectionId &id);
|
||||
void OnLatencyTestFinished(const ConnectionId &id, const uint average);
|
||||
inline void RecalculateConnectionsCount()
|
||||
{
|
||||
auto connectionCount = ConnectionManager->Connections(groupId).count();
|
||||
latencyLabel->setText(QSTRN(connectionCount) + " " + (connectionCount < 2 ? tr("connection") : tr("connections")));
|
||||
}
|
||||
void RecalculateConnectionsCount();
|
||||
void OnConnectionItemRenamed(const ConnectionId &id, const QString &, const QString &newName);
|
||||
void OnGroupItemRenamed(const GroupId &id, const QString &, const QString &newName);
|
||||
void on_doRenameBtn_clicked();
|
||||
|
@ -1,10 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "QWidget"
|
||||
#include "base/Qv2rayBase.hpp"
|
||||
#include "ui/messaging/QvMessageBus.hpp"
|
||||
#include "ui_StreamSettingsWidget.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class StreamSettingsWidget
|
||||
: public QWidget
|
||||
, private Ui::StreamSettingsWidget
|
||||
|
Loading…
Reference in New Issue
Block a user