minor improvements

This commit is contained in:
Nova 2025-03-20 15:02:03 +03:30
parent 0d2f073069
commit c83d3c7506
4 changed files with 4 additions and 18 deletions

View File

@ -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);

View File

@ -77,7 +77,6 @@ namespace Qv2ray {
QTextCharFormat dateFormat;
QTextCharFormat acceptedFormat;
QTextCharFormat rejectedFormat;
QTextCharFormat failedFormat;
QTextCharFormat warningFormat;
QTextCharFormat warningFormat2;
QTextCharFormat infoFormat;

View File

@ -1,6 +1,7 @@
#pragma once
#include <memory>
#include <QElapsedTimer>
#include <QProcess>
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;

View File

@ -4,7 +4,6 @@
#include <QTimer>
#include <QDir>
#include <QApplication>
#include <QElapsedTimer>
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() {