minor refactor

This commit is contained in:
arm64v8a
2023-05-22 11:07:14 +09:00
parent 1b050dd3fb
commit c5122b77e4
98 changed files with 1173 additions and 1142 deletions

View File

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