From 8c8a58fb072f0fbc20375b9df649635b8141788e Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 15 May 2020 03:03:47 -0400 Subject: [PATCH] Remove superfluous private PythonBridge stuff --- .../PythonBridge/{Privates => }/EventHandlers.qml | 0 src/gui/PythonBridge/{Privates => }/Globals.qml | 0 src/gui/PythonBridge/PythonBridge.qml | 14 +++++--------- src/gui/PythonBridge/PythonRootBridge.qml | 2 +- src/gui/PythonBridge/{Privates => }/qmldir | 0 5 files changed, 6 insertions(+), 10 deletions(-) rename src/gui/PythonBridge/{Privates => }/EventHandlers.qml (100%) rename src/gui/PythonBridge/{Privates => }/Globals.qml (100%) rename src/gui/PythonBridge/{Privates => }/qmldir (100%) 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