From 7963f03f55bf5cf5a5cbc7b1c596d31da9c7477e Mon Sep 17 00:00:00 2001 From: Qv2ray-dev <59914293+Qv2ray-dev@users.noreply.github.com> Date: Fri, 15 May 2020 00:44:20 +0800 Subject: [PATCH] fix: fixed connection issue --- makespec/BUILDVERSION | 2 +- src/core/handler/ConfigHandler.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index 2ecfc282..597adfa6 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -5402 +5403 \ No newline at end of file diff --git a/src/core/handler/ConfigHandler.cpp b/src/core/handler/ConfigHandler.cpp index 2b166e6c..698b3865 100644 --- a/src/core/handler/ConfigHandler.cpp +++ b/src/core/handler/ConfigHandler.cpp @@ -330,7 +330,7 @@ namespace Qv2ray::core::handlers } else { - QDir(QV2RAY_CONNECTIONS_DIR + id.toString()).removeRecursively(); + QFile(QV2RAY_CONNECTIONS_DIR + id.toString()).remove(); } // PluginHost->Send_ConnectionEvent({ Events::ConnectionEntry::FullyRemoved, groups[id].displayName, "" }); @@ -347,11 +347,10 @@ namespace Qv2ray::core::handlers const std::optional QvConfigHandler::StartConnection(const ConnectionId &id, const GroupId &group) { - return {}; - // CheckConnectionExistance(id); - // connections[id].lastConnected = system_clock::to_time_t(system_clock::now()); - // CONFIGROOT root = GetConnectionRoot(id); - // return kernelHandler->StartConnection(id, root); + CheckConnectionExistance(id); + connections[id].lastConnected = system_clock::to_time_t(system_clock::now()); + CONFIGROOT root = GetConnectionRoot(id); + return kernelHandler->StartConnection({ id, group }, root); } void QvConfigHandler::RestartConnection() // const ConnectionId &id