From 0871e751fab2fbe595fc6c96d8edd750e90742d3 Mon Sep 17 00:00:00 2001 From: polos Date: Thu, 25 Mar 2021 10:38:50 +0100 Subject: [PATCH] revision of Sailfish ini --- src/eql.cpp | 2 +- src/lisp/qml.lisp | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/eql.cpp b/src/eql.cpp index 25d52c2..155533e 100644 --- a/src/eql.cpp +++ b/src/eql.cpp @@ -9,7 +9,7 @@ #include #include -const char EQL::version[] = "21.3.3"; // March 2021 +const char EQL::version[] = "21.3.4"; // March 2021 extern "C" void ini_EQL(cl_object); diff --git a/src/lisp/qml.lisp b/src/lisp/qml.lisp index 1aa11ae..67ee609 100644 --- a/src/lisp/qml.lisp +++ b/src/lisp/qml.lisp @@ -172,7 +172,7 @@ (print-js-readably object)))) (defun %qjs (item/name function-name &rest arguments) - ;; QJS-CALL is defined in EQL5, function 'ecl_fun.cpp' + ;; see 'ecl_fun.cpp::qjs_call()' (qrun* (eql::qjs-call (quick-item item/name) function-name arguments))) (defmacro qjs (function-name item/name &rest arguments) @@ -211,13 +211,13 @@ ;;; for SailfishOS -(defun ini-sailfish (file/url &optional root quick-view) +(defun ini-sailfish (file/url &optional root quick-view (start-event-loop t)) + "Pass either just the main QML file (during development), or all of: main QML url, root url, Sailfish QQuickView (in final app)." (when (and root (qt-object-p root) (= (qid "QUrl") (qt-object-id root))) (setf *root* (x:cc (|toString| root) "/"))) (setf *quick-view* (or quick-view (qnew "QQuickView"))) - (qconnect (|engine| *quick-view*) "quit()" 'qquit) (qnew "QQmlFileSelector(QQmlEngine*,QObject*)" (|engine| *quick-view*) *quick-view*) (|setSource| *quick-view* (if (stringp file/url) (file-to-url file/url) @@ -228,12 +228,6 @@ #.(make-string 2 :initial-element #\Newline)))) (|setResizeMode| *quick-view* |QQuickView.SizeRootObjectToView|) (|show| *quick-view*) - (when quick-view - ;; for compiled app; - ;; we add a fallback restart for eventual connections from Slime; - ;; this is needed if an exception occurs during event driven - ;; function calls (which would otherwise block the Slime REPL) - (loop - (with-simple-restart (restart-qt-events "Restart Qt event processing.") - (qexec))))) + (when (and quick-view start-event-loop) + (qexec)))