mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 10:50:23 +08:00
[fix] Fixed tProxy issue and getConfigPath function
Former-commit-id: 09e4385544
This commit is contained in:
parent
bfc3866b45
commit
14d1896cd9
@ -1 +1 @@
|
|||||||
146
|
155
|
||||||
|
@ -43,7 +43,7 @@ namespace Qv2ray
|
|||||||
{
|
{
|
||||||
ConfigDirPath = *path;
|
ConfigDirPath = *path;
|
||||||
|
|
||||||
if (path->endsWith("/")) {
|
if (!path->endsWith("/")) {
|
||||||
ConfigDirPath += "/";
|
ConfigDirPath += "/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -329,17 +329,30 @@ void PrefrencesWindow::on_tProxyCheckBox_stateChanged(int arg1)
|
|||||||
} else {
|
} else {
|
||||||
LOG(MODULE_VCORE, "ENABLING tProxy Support")
|
LOG(MODULE_VCORE, "ENABLING tProxy Support")
|
||||||
LOG(MODULE_FILE, " --> Origin v2ray core file is at: " + CurrentConfig.v2CorePath)
|
LOG(MODULE_FILE, " --> Origin v2ray core file is at: " + CurrentConfig.v2CorePath)
|
||||||
auto v2ctlPath = QFileInfo(QSTRING(CurrentConfig.v2CorePath)).path();
|
auto v2ctlPath = QFileInfo(QSTRING(CurrentConfig.v2CorePath)).path() + "/v2ctl";
|
||||||
auto newPath = QFileInfo(QV2RAY_DEFAULT_VCORE_PATH).path();
|
auto newPath = QFileInfo(QV2RAY_DEFAULT_VCORE_PATH).path();
|
||||||
//
|
//
|
||||||
LOG(MODULE_FILE, " --> Origin v2ray core file is at: " + v2ctlPath.toStdString() + "v2ctl")
|
LOG(MODULE_FILE, " --> Origin v2ray core file is at: " + v2ctlPath.toStdString() + "/v2ctl")
|
||||||
LOG(MODULE_FILE, " --> New v2ray files will be placed in: " << newPath.toStdString())
|
LOG(MODULE_FILE, " --> New v2ray files will be placed in: " << newPath.toStdString())
|
||||||
//
|
//
|
||||||
LOG(MODULE_FILE, " --> Copying files....")
|
LOG(MODULE_FILE, " --> Copying files....")
|
||||||
|
|
||||||
|
if (QFile(QV2RAY_DEFAULT_VCORE_PATH).exists()) {
|
||||||
|
LOG(MODULE_FILE, QV2RAY_DEFAULT_VCORE_PATH.toStdString() << ": File already exists.")
|
||||||
|
LOG(MODULE_FILE, QV2RAY_DEFAULT_VCORE_PATH.toStdString() << ": Deleting file.")
|
||||||
|
QFile(QV2RAY_DEFAULT_VCORE_PATH).remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (QFile(newPath + "/v2ctl").exists()) {
|
||||||
|
LOG(MODULE_FILE, newPath.toStdString() << "/v2ctl" << ": File already exists.")
|
||||||
|
LOG(MODULE_FILE, newPath.toStdString() << "/v2ctl" << ": Deleting file.")
|
||||||
|
QFile(newPath + "/v2ctl").remove();
|
||||||
|
}
|
||||||
|
|
||||||
string vCoreresult = QFile(QSTRING(CurrentConfig.v2CorePath)).copy(QV2RAY_DEFAULT_VCORE_PATH) ? "OK" : "FAILED";
|
string vCoreresult = QFile(QSTRING(CurrentConfig.v2CorePath)).copy(QV2RAY_DEFAULT_VCORE_PATH) ? "OK" : "FAILED";
|
||||||
LOG(MODULE_FILE, " --> v2ray Core: " + vCoreresult)
|
LOG(MODULE_FILE, " --> v2ray Core: " + vCoreresult)
|
||||||
//
|
//
|
||||||
string vCtlresult = QFile(v2ctlPath).copy(newPath + "v2ctl") ? "OK" : "FAILED";
|
string vCtlresult = QFile(v2ctlPath).copy(newPath + "/v2ctl") ? "OK" : "FAILED";
|
||||||
LOG(MODULE_FILE, " --> v2ray Ctl: " + vCtlresult)
|
LOG(MODULE_FILE, " --> v2ray Ctl: " + vCtlresult)
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<property name="modal">
|
<property name="modal">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_5" rowstretch="1,1,0" columnstretch="1,2">
|
<layout class="QGridLayout" name="gridLayout_5" rowstretch="1,1,0" columnstretch="4,7">
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user