diff --git a/plugins/KasenAPIExample/src/DeprecatedScriptPlugin.h b/plugins/KasenAPIExample/src/ExampleScriptPlugin.h similarity index 85% rename from plugins/KasenAPIExample/src/DeprecatedScriptPlugin.h rename to plugins/KasenAPIExample/src/ExampleScriptPlugin.h index dc2b660066..a6af105e0e 100644 --- a/plugins/KasenAPIExample/src/DeprecatedScriptPlugin.h +++ b/plugins/KasenAPIExample/src/ExampleScriptPlugin.h @@ -1,5 +1,5 @@ // -// DeprecatedScriptPlugin.h +// ExampleScriptPlugin.h // plugins/KasenAPIExample/src // // Created by Kasen IO on 2019.07.14 | realities.dev | kasenvr@gmail.com @@ -10,8 +10,8 @@ // // Supporting file containing all QtScript specific integration. -#ifndef DEPRECATED_SCRIPT_PLUGIN_H -#define DEPRECATED_SCRIPT_PLUGIN_H +#ifndef EXAMPLE_SCRIPT_PLUGIN_H +#define EXAMPLE_SCRIPT_PLUGIN_H #if DEV_BUILD #pragma message("QtScript is deprecated see: doc.qt.io/qt-5/topics-scripting.html") @@ -22,16 +22,14 @@ #include #include -namespace deprecated { +namespace example { extern const QLoggingCategory& logger; inline void setGlobalInstance(QScriptEngine* engine, const QString& name, QObject* object) { auto value = engine->newQObject(object, QScriptEngine::QtOwnership); engine->globalObject().setProperty(name, value); - if (1 || getenv("DEBUG")) { - qCDebug(logger) << "(via ScriptInitializers)...setGlobalInstance" << name << engine->property("fileName"); - } + qCDebug(logger) << "setGlobalInstance" << name << engine->property("fileName"); } class ScriptPlugin : public QObject { @@ -53,6 +51,6 @@ public slots: inline QString toString() const { return QString("[%1 version=%2]").arg(objectName()).arg(_version); } }; -} // namespace deprecated +} // namespace example #endif \ No newline at end of file diff --git a/plugins/KasenAPIExample/src/KasenAPIExample.cpp b/plugins/KasenAPIExample/src/KasenAPIExample.cpp index f781c0be28..d566d11376 100644 --- a/plugins/KasenAPIExample/src/KasenAPIExample.cpp +++ b/plugins/KasenAPIExample/src/KasenAPIExample.cpp @@ -10,7 +10,7 @@ // // Example of prototyping new JS APIs by leveraging the existing plugin system. -#include "DeprecatedScriptPlugin.h" +#include "ExampleScriptPlugin.h" #include #include @@ -25,11 +25,11 @@ namespace custom_api_example { QLoggingCategory logger{ "custom_api_example" }; -class KasenAPIExample : public deprecated::ScriptPlugin { +class KasenAPIExample : public example::ScriptPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "KasenAPIExample" FILE "plugin.json") public: - KasenAPIExample() : deprecated::ScriptPlugin("KasenAPIExample", "0.0.0") { + KasenAPIExample() : example::ScriptPlugin("KasenAPIExample", "0.0.1") { qCInfo(logger) << "plugin loaded" << qApp << toString() << QThread::currentThread(); } @@ -134,6 +134,6 @@ private: } -const QLoggingCategory& deprecated::logger{ custom_api_example::logger }; +const QLoggingCategory& example::logger{ custom_api_example::logger }; #include "KasenAPIExample.moc" diff --git a/plugins/KasenAPIExample/src/plugin.json b/plugins/KasenAPIExample/src/plugin.json index 2d113c700f..3e6931deec 100644 --- a/plugins/KasenAPIExample/src/plugin.json +++ b/plugins/KasenAPIExample/src/plugin.json @@ -4,7 +4,7 @@ "package": { "author": "Revofire", "homepage": "www.realities.dev", - "version": "0.0.0", + "version": "0.0.1", "engines": { "hifi-interface": ">= 0.83.0", "hifi-assignment-client": ">= 0.83.0"