Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
fix: fixed TrojanGo plugin settings save issue
Browse files Browse the repository at this point in the history
  • Loading branch information
QxQ authored and QxQ committed Sep 22, 2020
1 parent 982e2ec commit be63ee4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions TrojanGoPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#include <QLabel>
#include <QMetaEnum>

bool QvTrojanGoPlugin::InitializePlugin(const QString &, const QJsonObject &)
bool QvTrojanGoPlugin::InitializePlugin(const QString &, const QJsonObject &_settings)
{
emit PluginLog("Initialize plugin.");
PluginInstance = this;
this->settings = _settings;
QvTrojanGoPluginInstance = this;
outboundHandler = std::make_shared<TrojanGoSerializer>();
eventHandler = std::make_shared<SimpleEventHandler>();
kernelInterface = std::make_unique<TrojanGoPluginKernelInterface>();
Expand Down
2 changes: 1 addition & 1 deletion TrojanGoPlugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ class QvTrojanGoPlugin
void PluginErrorMessageBox(const QString &, const QString &) const override;
};

inline QvTrojanGoPlugin *PluginInstance;
DECLARE_PLUGIN_INSTANCE(QvTrojanGoPlugin);
6 changes: 3 additions & 3 deletions core/Kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ QvTrojanGoPluginKernel::QvTrojanGoPluginKernel() : Qv2rayPlugin::PluginKernel()

bool QvTrojanGoPluginKernel::StartKernel()
{
const auto executablePath = PluginInstance->GetSettngs()["kernelPath"].toString();
const auto executablePath = QvTrojanGoPluginInstance->GetSettngs()["kernelPath"].toString();
if (!QFile::exists(executablePath))
{
PluginInstance->PluginErrorMessageBox(tr("Stupid Configuration?"),
tr("We cannot find your Trojan-Go kernel. Please configure it in the plugin settings."));
QvTrojanGoPluginInstance->PluginErrorMessageBox(tr("Stupid Configuration?"),
tr("We cannot find your Trojan-Go kernel. Please configure it in the plugin settings."));
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion interface

0 comments on commit be63ee4

Please sign in to comment.