summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-12-04 06:55:54 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-12-04 06:55:54 (GMT)
commit4b7d33dad388f21a8903d14af65b3cce2e57ff62 (patch)
tree303407f345dc956215184d9b0ea87fdfd297b695 /src/declarative
parentf6f290ba3f36e0a686dffeaf0a4b4bd85b414172 (diff)
parent898ccd0b94cf8c6b7fe3b33f85fb40ee7ea759b7 (diff)
downloadQt-4b7d33dad388f21a8903d14af65b3cce2e57ff62.zip
Qt-4b7d33dad388f21a8903d14af65b3cce2e57ff62.tar.gz
Qt-4b7d33dad388f21a8903d14af65b3cce2e57ff62.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlsqldatabase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp
index 3ddfec3..b550f96 100644
--- a/src/declarative/qml/qmlsqldatabase.cpp
+++ b/src/declarative/qml/qmlsqldatabase.cpp
@@ -196,6 +196,11 @@ static QScriptValue qmlsqldatabase_item(QScriptContext *context, QScriptEngine *
return engine->undefinedValue();
}
+static QScriptValue qmlsqldatabase_executeSql_outsidetransaction(QScriptContext *context, QScriptEngine *engine)
+{
+ THROW_SQL(DATABASE_ERR,QmlEngine::tr("executeSql called outside transaction()"));
+}
+
static QScriptValue qmlsqldatabase_executeSql(QScriptContext *context, QScriptEngine *engine)
{
QSqlDatabase db = qscriptvalue_cast<QSqlDatabase>(context->thisObject());
@@ -308,6 +313,8 @@ static QScriptValue qmlsqldatabase_transaction_shared(QScriptContext *context, Q
db.transaction();
callback.call(QScriptValue(), QScriptValueList() << tx);
+ instance.setProperty(QLatin1String("executeSql"),
+ engine->newFunction(qmlsqldatabase_executeSql_outsidetransaction));
if (engine->hasUncaughtException()) {
db.rollback();
} else {