From 91ef9f4fdcffb76bf42709d32409b08a12889a6c Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Sun, 20 Apr 2025 10:45:37 +0200 Subject: [PATCH] example 'clog-demo': fix double connection id; revisions --- examples/clog-demo/app.asd | 2 +- examples/clog-demo/qml/ext/Browser.qml | 8 +------- examples/clog-demo/qml/ext/Server.qml | 2 +- examples/clog-demo/readme-build.md | 2 +- examples/clog-demo/readme.md | 12 ++++++------ examples/clog-demo/run.lisp | 7 ++++--- 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/examples/clog-demo/app.asd b/examples/clog-demo/app.asd index d1190b0..452321d 100644 --- a/examples/clog-demo/app.asd +++ b/examples/clog-demo/app.asd @@ -5,7 +5,7 @@ :components ((:file "lisp/package") (:file "lisp/ini") (:file "lisp/ui-vars") - (:file "lisp/swank-quicklisp") + #+mobile (:file "lisp/swank-quicklisp") (:file "lisp/eval") (:file "lisp/clog-bridge") (:file "clog-assets/demos/01-demo") diff --git a/examples/clog-demo/qml/ext/Browser.qml b/examples/clog-demo/qml/ext/Browser.qml index abf3096..5510aaa 100644 --- a/examples/clog-demo/qml/ext/Browser.qml +++ b/examples/clog-demo/qml/ext/Browser.qml @@ -9,15 +9,9 @@ Item { WebView { id: browser objectName: "browser" - width: parent. width + width: parent.width height: parent.height - reload.height visible: !busy.visible - - onLoadingChanged: { - if (loadRequest.status === WebView.LoadSucceededStatus) { - Lisp.call("clog:webview/on-new-connection") - } - } } Button { diff --git a/examples/clog-demo/qml/ext/Server.qml b/examples/clog-demo/qml/ext/Server.qml index c612b5b..26a7189 100644 --- a/examples/clog-demo/qml/ext/Server.qml +++ b/examples/clog-demo/qml/ext/Server.qml @@ -16,7 +16,7 @@ Item { client.sendTextMessage(message) } - onClientConnected: { + onClientConnected: (webSocket) => { client = webSocket webSocket.objectName = ++counter main.log("[new] " + counter) diff --git a/examples/clog-demo/readme-build.md b/examples/clog-demo/readme-build.md index ebe9334..cc0b104 100644 --- a/examples/clog-demo/readme-build.md +++ b/examples/clog-demo/readme-build.md @@ -3,7 +3,7 @@ Prepare ------- First you need to patch ASDF from ECL android. So, switch to where you have -ecl-android installed, and edit file: 'contrib/asdf/asdf.lisp'. +ecl-android installed, and edit file: `contrib/asdf/asdf.lisp`. Find the following function, and replace it with this code: ``` diff --git a/examples/clog-demo/readme.md b/examples/clog-demo/readme.md index 218ab33..135e46d 100644 --- a/examples/clog-demo/readme.md +++ b/examples/clog-demo/readme.md @@ -29,12 +29,12 @@ for installing the Slime sources where this example can find them. `~/quicklisp/local-projects/` directory: [CLOG for mobile](https://gitlab.com/eql/clog-for-mobile/-/blob/main/clog-2.2.tgz). -If you want to run this example on the desktop, you need to uncomment the Qt -WebEngine dependency in [../../src/lqml.pro](../../src/lqml.pro) and rebuild -the `lqml` executable. Additionally you need to clear the ECL cache of CLOG -(see `~/.cache/common-lisp/ecl-...`), because the CLOG desktop version for LQML -is different from the standard version (see `#+mobile` in CLOG fork, which is -also needed on the desktop, if used with LQML). +If you want to run this example on the desktop (only tested with Qt6), you need +to uncomment the Qt WebEngine dependency in [../../src/lqml.pro](../../src/lqml.pro) +and rebuild the `lqml` executable. Additionally you need to clear the ECL cache +of CLOG (see `~/.cache/common-lisp/ecl-...`), because the CLOG desktop version +for LQML is different from the standard version (see `#+mobile` in CLOG fork, +which is also needed on the desktop, if used with LQML). diff --git a/examples/clog-demo/run.lisp b/examples/clog-demo/run.lisp index e498414..244725c 100644 --- a/examples/clog-demo/run.lisp +++ b/examples/clog-demo/run.lisp @@ -2,9 +2,10 @@ (require :asdf) -(pushnew :mobile *features*) - -(asdf:load-system :clog) +(progn + (pushnew :mobile *features*) + (asdf:load-system :clog) + (setf *features* (remove :mobile *features*))) (push (merge-pathnames "./") asdf:*central-registry*)