diff --git a/src/gui/PythonBridge/Privates/EventHandlers.qml b/src/gui/PythonBridge/EventHandlers.qml similarity index 100% rename from src/gui/PythonBridge/Privates/EventHandlers.qml rename to src/gui/PythonBridge/EventHandlers.qml diff --git a/src/gui/PythonBridge/Privates/Globals.qml b/src/gui/PythonBridge/Globals.qml similarity index 100% rename from src/gui/PythonBridge/Privates/Globals.qml rename to src/gui/PythonBridge/Globals.qml diff --git a/src/gui/PythonBridge/PythonBridge.qml b/src/gui/PythonBridge/PythonBridge.qml index 069ab48c..f735278e 100644 --- a/src/gui/PythonBridge/PythonBridge.qml +++ b/src/gui/PythonBridge/PythonBridge.qml @@ -3,27 +3,23 @@ import QtQuick 2.12 import io.thp.pyotherside 1.5 import CppUtils 0.1 -import "Privates" +import "." Python { id: py - readonly property QtObject privates: QtObject { - function makeFuture(callback) { - return Qt.createComponent("Future.qml") - .createObject(py, { bridge: py }) - } + function makeFuture(callback) { + return Qt.createComponent("Future.qml").createObject(py, {bridge: py}) } - function setattr(obj, attr, value, callback=null) { py.call(py.getattr(obj, "__setattr__"), [attr, value], callback) } function callCoro(name, args=[], onSuccess=null, onError=null) { const uuid = name + "." + CppUtils.uuid() - const future = privates.makeFuture() + const future = makeFuture() Globals.pendingCoroutines[uuid] = {future, onSuccess, onError} Globals.pendingCoroutinesChanged() @@ -38,7 +34,7 @@ Python { function callClientCoro( accountId, name, args=[], onSuccess=null, onError=null ) { - const future = privates.makeFuture() + const future = makeFuture() callCoro("get_client", [accountId], () => { const uuid = accountId + "." + name + "." + CppUtils.uuid() diff --git a/src/gui/PythonBridge/PythonRootBridge.qml b/src/gui/PythonBridge/PythonRootBridge.qml index 5e6eb189..9045428d 100644 --- a/src/gui/PythonBridge/PythonRootBridge.qml +++ b/src/gui/PythonBridge/PythonRootBridge.qml @@ -1,7 +1,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick 2.12 -import "Privates" +import "." PythonBridge { Component.onCompleted: { diff --git a/src/gui/PythonBridge/Privates/qmldir b/src/gui/PythonBridge/qmldir similarity index 100% rename from src/gui/PythonBridge/Privates/qmldir rename to src/gui/PythonBridge/qmldir