revision of Sailfish ini

This commit is contained in:
polos 2021-03-25 10:38:50 +01:00
parent afacf3f74d
commit 0871e751fa
2 changed files with 6 additions and 12 deletions

View file

@ -9,7 +9,7 @@
#include <QStringList>
#include <QDebug>
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);

View file

@ -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)))