From 307b0cb8d2f99c97c8945a3ff644f720e3901ac8 Mon Sep 17 00:00:00 2001 From: polos Date: Thu, 2 Feb 2017 10:49:51 +0100 Subject: [PATCH] small revisions --- examples/M-modules/quick/Tic-Tac-Toe/qml-lisp.lisp | 2 +- examples/M-modules/quick/item-model/qml-lisp.lisp | 2 +- examples/M-modules/quick/item-model/qml/abstract-model.qml | 2 +- examples/M-modules/quick/qml-lisp/qml-lisp.lisp | 2 +- src/ecl_fun.cpp | 6 +++--- src/eql5.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/M-modules/quick/Tic-Tac-Toe/qml-lisp.lisp b/examples/M-modules/quick/Tic-Tac-Toe/qml-lisp.lisp index cbcce55..ee02fa3 100644 --- a/examples/M-modules/quick/Tic-Tac-Toe/qml-lisp.lisp +++ b/examples/M-modules/quick/Tic-Tac-Toe/qml-lisp.lisp @@ -68,7 +68,7 @@ (defun qml-apply (caller function arguments) "Every 'Lisp.call()' or 'Lisp.apply()' function call in QML will call this function. The variable *CALLER* will be bound to the calling QQuickItem, if passed with 'this' as first argument to 'Lisp.call()' / 'Lisp.apply()'." - (let* ((*caller* (if (qnull caller) nil (qt-object-? caller))) + (let* ((*caller* (if (qnull caller) *caller* (qt-object-? caller))) (object (apply (string-to-symbol function) arguments))) (if (stringp object) diff --git a/examples/M-modules/quick/item-model/qml-lisp.lisp b/examples/M-modules/quick/item-model/qml-lisp.lisp index cbcce55..ee02fa3 100644 --- a/examples/M-modules/quick/item-model/qml-lisp.lisp +++ b/examples/M-modules/quick/item-model/qml-lisp.lisp @@ -68,7 +68,7 @@ (defun qml-apply (caller function arguments) "Every 'Lisp.call()' or 'Lisp.apply()' function call in QML will call this function. The variable *CALLER* will be bound to the calling QQuickItem, if passed with 'this' as first argument to 'Lisp.call()' / 'Lisp.apply()'." - (let* ((*caller* (if (qnull caller) nil (qt-object-? caller))) + (let* ((*caller* (if (qnull caller) *caller* (qt-object-? caller))) (object (apply (string-to-symbol function) arguments))) (if (stringp object) diff --git a/examples/M-modules/quick/item-model/qml/abstract-model.qml b/examples/M-modules/quick/item-model/qml/abstract-model.qml index 856f0ae..55799bb 100644 --- a/examples/M-modules/quick/item-model/qml/abstract-model.qml +++ b/examples/M-modules/quick/item-model/qml/abstract-model.qml @@ -7,5 +7,5 @@ ListView { x: 5; y: 5; width: 200; height: 250 model: myModel - delegate: Text { text: "animal: " + kind + ", " + size } + delegate: Text { text: "animal: " + kind + ", " + size } } diff --git a/examples/M-modules/quick/qml-lisp/qml-lisp.lisp b/examples/M-modules/quick/qml-lisp/qml-lisp.lisp index cbcce55..ee02fa3 100644 --- a/examples/M-modules/quick/qml-lisp/qml-lisp.lisp +++ b/examples/M-modules/quick/qml-lisp/qml-lisp.lisp @@ -68,7 +68,7 @@ (defun qml-apply (caller function arguments) "Every 'Lisp.call()' or 'Lisp.apply()' function call in QML will call this function. The variable *CALLER* will be bound to the calling QQuickItem, if passed with 'this' as first argument to 'Lisp.call()' / 'Lisp.apply()'." - (let* ((*caller* (if (qnull caller) nil (qt-object-? caller))) + (let* ((*caller* (if (qnull caller) *caller* (qt-object-? caller))) (object (apply (string-to-symbol function) arguments))) (if (stringp object) diff --git a/src/ecl_fun.cpp b/src/ecl_fun.cpp index b29e4d0..d66e105 100644 --- a/src/ecl_fun.cpp +++ b/src/ecl_fun.cpp @@ -2526,10 +2526,10 @@ cl_object qtranslate(cl_object l_con, cl_object l_src, cl_object l_n) { QByteArray source(toQString(l_src).toUtf8()); int n = toInt(l_n); cl_object l_ret; - if(n == -1) { - l_ret = from_qstring(QCoreApplication::translate(context, source)); } - else { + if(n > 0) { l_ret = from_qstring(QCoreApplication::translate(context, source, 0, n)); } + else { + l_ret = from_qstring(QCoreApplication::translate(context, source)); } return l_ret; } cl_object qlocal8bit(cl_object l_str) { diff --git a/src/eql5.js b/src/eql5.js index 8ab4429..e465fa4 100644 --- a/src/eql5.js +++ b/src/eql5.js @@ -54,4 +54,4 @@ function apply(arg1, arg2, arg3) { function tr(source, context, pluralNumber) { // for i18n - return EQL5.apply(null, "eql:qtranslate", [context, source, (typeof(pluralNumber) == "number") ? pluralNumber : 0]); } + return EQL5.apply(null, "eql:qtranslate", [context, source, pluralNumber]); }