summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@digia.com>2013-02-26 10:42:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-26 11:35:54 +0100
commitd4fbebb3e3b7c8f0c171a76f7ea2314985d5fb2a (patch)
tree50f4bdeec2ea4e9e75da66a706e92be27a0da649
parent7a09d123cb29129419dea33c4e2ef0217b339a44 (diff)
downloadqtscript-d4fbebb3e3b7c8f0c171a76f7ea2314985d5fb2a.tar.gz
Fix a typo in QScript example.
LoadScript function should iterate over arguments and load all scripts not only the first one. Task-number: QTBUG-28805 Change-Id: I03c6764946cfb403ff5af818bfc45b41524ad5c6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--examples/script/qscript/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/script/qscript/main.cpp b/examples/script/qscript/main.cpp
index 0a6bd4d..189b1ad 100644
--- a/examples/script/qscript/main.cpp
+++ b/examples/script/qscript/main.cpp
@@ -119,7 +119,7 @@ static QScriptValue importExtension(QScriptContext *context, QScriptEngine *engi
static QScriptValue loadScripts(QScriptContext *context, QScriptEngine *engine)
{
for (int i = 0; i < context->argumentCount(); ++i) {
- QString fileName = context->argument(0).toString();
+ QString fileName = context->argument(i).toString();
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
return context->throwError(QString::fromLatin1("could not open %0 for reading").arg(fileName));