From c83d3c750620b602ceb7b6b466fd931b9e56fb9a Mon Sep 17 00:00:00 2001 From: Nova Date: Thu, 20 Mar 2025 15:02:03 +0330 Subject: [PATCH] minor improvements --- 3rdparty/qv2ray/v2/ui/LogHighlighter.cpp | 7 ------- 3rdparty/qv2ray/v2/ui/LogHighlighter.hpp | 1 - include/sys/Process.hpp | 4 +++- src/sys/Process.cpp | 10 +--------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/3rdparty/qv2ray/v2/ui/LogHighlighter.cpp b/3rdparty/qv2ray/v2/ui/LogHighlighter.cpp index ae113de..23ee75d 100644 --- a/3rdparty/qv2ray/v2/ui/LogHighlighter.cpp +++ b/3rdparty/qv2ray/v2/ui/LogHighlighter.cpp @@ -76,13 +76,6 @@ namespace Qv2ray::ui { rule.format = v2rayComponentFormat; highlightingRules.append(rule); // - failedFormat.setFontWeight(QFont::Bold); - failedFormat.setBackground(Qt::red); - failedFormat.setForeground(Qt::white); - rule.pattern = QRegularExpression("failed"); - rule.format = failedFormat; - highlightingRules.append(rule); - // rule.pattern = QRegularExpression(">>>>+"); rule.format = warningFormat; highlightingRules.append(rule); diff --git a/3rdparty/qv2ray/v2/ui/LogHighlighter.hpp b/3rdparty/qv2ray/v2/ui/LogHighlighter.hpp index 4c24a44..f6df634 100644 --- a/3rdparty/qv2ray/v2/ui/LogHighlighter.hpp +++ b/3rdparty/qv2ray/v2/ui/LogHighlighter.hpp @@ -77,7 +77,6 @@ namespace Qv2ray { QTextCharFormat dateFormat; QTextCharFormat acceptedFormat; QTextCharFormat rejectedFormat; - QTextCharFormat failedFormat; QTextCharFormat warningFormat; QTextCharFormat warningFormat2; QTextCharFormat infoFormat; diff --git a/include/sys/Process.hpp b/include/sys/Process.hpp index 02ce1a7..55cb4f4 100644 --- a/include/sys/Process.hpp +++ b/include/sys/Process.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include namespace NekoGui_sys { @@ -10,7 +11,6 @@ namespace NekoGui_sys { QString tag; QString program; QStringList arguments; - QStringList env; ~CoreProcess(); @@ -31,6 +31,8 @@ namespace NekoGui_sys { bool failed_to_start = false; bool restarting = false; + QElapsedTimer coreRestartTimer; + protected: bool started = false; bool killed = false; diff --git a/src/sys/Process.cpp b/src/sys/Process.cpp index e10ef01..c3d4469 100644 --- a/src/sys/Process.cpp +++ b/src/sys/Process.cpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace NekoGui_sys { CoreProcess::~CoreProcess() { @@ -20,12 +19,7 @@ namespace NekoGui_sys { } } - // - - QElapsedTimer coreRestartTimer; - CoreProcess::CoreProcess(const QString &core_path, const QStringList &args) : QProcess() { - this->env = QProcessEnvironment::systemEnvironment().toStringList(); program = core_path; arguments = args; @@ -88,13 +82,11 @@ namespace NekoGui_sys { } void CoreProcess::Start() { - show_stderr = false; if (started) return; started = true; - setEnvironment(env); + setEnvironment(QProcessEnvironment::systemEnvironment().toStringList()); start(program, arguments); - write((NekoGui::dataStore->core_token + "\n").toUtf8()); } void CoreProcess::Restart() {