summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-14 10:43:04 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-14 10:43:04 (GMT)
commitccd85016aa7d95495ab113bd5cecc62769a5fad4 (patch)
tree91eddc0e5597254319e89466d08eab5ff20e9a5a /src
parent0dbd8f1b0a6df20e5502bb35e58490a9f99953a7 (diff)
parent00f01532342713e4adae0ce8ccd332829acfeec0 (diff)
downloadQt-ccd85016aa7d95495ab113bd5cecc62769a5fad4.zip
Qt-ccd85016aa7d95495ab113bd5cecc62769a5fad4.tar.gz
Qt-ccd85016aa7d95495ab113bd5cecc62769a5fad4.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Improve test coverage of QtScript translation functions QFtp: Fix possible crash
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qftp.cpp6
-rw-r--r--src/script/api/qscriptengine.cpp4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index efeef4e..7f6df0a 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -2309,6 +2309,12 @@ void QFtpPrivate::_q_piFinished(const QString&)
void QFtpPrivate::_q_piError(int errorCode, const QString &text)
{
Q_Q(QFtp);
+
+ if (pending.isEmpty()) {
+ qWarning() << "QFtpPrivate::_q_piError was called without pending command!";
+ return;
+ }
+
QFtpCommand *c = pending.first();
// non-fatal errors
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index ccd3e56..9bd98f1 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -663,7 +663,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObje
else if (encStr == QLatin1String("UnicodeUTF8"))
encoding = QCoreApplication::UnicodeUTF8;
else
- return JSC::throwError(exec, JSC::GeneralError, QString::fromLatin1("qsTranslate(): invalid encoding '%s'").arg(encStr));
+ return JSC::throwError(exec, JSC::GeneralError, QString::fromLatin1("qsTranslate(): invalid encoding '%0'").arg(encStr));
}
int n = -1;
if (args.size() > 4)
@@ -697,7 +697,7 @@ JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState *exec, JSC::JSObject*, JS
if ((args.size() > 1) && !args.at(1).isString())
return JSC::throwError(exec, JSC::GeneralError, "qsTr(): second argument (comment) must be a string");
if ((args.size() > 2) && !args.at(2).isNumber())
- return JSC::throwError(exec, JSC::GeneralError, "qsTranslate(): third argument (n) must be a number");
+ return JSC::throwError(exec, JSC::GeneralError, "qsTr(): third argument (n) must be a number");
#ifndef QT_NO_QOBJECT
QString context;
// The first non-empty source URL in the call stack determines the translation context.