mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
minor refactor
This commit is contained in:
10
main/QJS.cpp
10
main/QJS.cpp
@@ -5,9 +5,9 @@
|
||||
#endif
|
||||
|
||||
#include "3rdparty/qjs/nekoray_qjs.h"
|
||||
#include "main/NekoRay.hpp"
|
||||
#include "main/NekoGui.hpp"
|
||||
|
||||
namespace NekoRay::qjs {
|
||||
namespace qjs {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
namespace exception {
|
||||
static void js_dump_obj(JSContext *ctx, QString &out, JSValueConst val) {
|
||||
@@ -80,7 +80,7 @@ namespace NekoRay::qjs {
|
||||
this->neko_ctx = malloc(sizeof(nekoray_qjs_context));
|
||||
nekoray_qjs_new_arg arg;
|
||||
arg.neko_ctx = NEKO_CTX;
|
||||
arg.enable_std = NekoRay::dataStore->enable_js_hook == 2 ? 1 : 0;
|
||||
arg.enable_std = NekoGui::dataStore->enable_js_hook == 2 ? 1 : 0;
|
||||
arg.func_log = func_log;
|
||||
nekoray_qjs_new(arg);
|
||||
#endif
|
||||
@@ -139,10 +139,10 @@ namespace NekoRay::qjs {
|
||||
|
||||
QByteArray ReadHookJS() {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
if (NekoRay::dataStore->enable_js_hook > 0) {
|
||||
if (NekoGui::dataStore->enable_js_hook > 0) {
|
||||
return ReadFile(QString("./hook.%1.js").arg(software_name.toLower()));
|
||||
}
|
||||
#endif
|
||||
return {};
|
||||
}
|
||||
} // namespace NekoRay::qjs
|
||||
} // namespace qjs
|
||||
|
||||
Reference in New Issue
Block a user