aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame4/content
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2012-01-24 16:07:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-25 06:32:34 +0100
commitb2869013fdfb76d60ce8750e24614111f78fef5c (patch)
treec57ec9c0cfc1226c1ac9d66735ddd267b20cffca /examples/declarative/tutorials/samegame/samegame4/content
parent149f6afe321ce59aebe4ce2f9dddd1881d0ac22b (diff)
Move sqldatabase into a module API plugin
Change-Id: Icd0bbfe16804abf1bbadbabddf3a30b5b18df30c Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame4/content')
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index ccc3f9dae2..7bb7243914 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -1,4 +1,6 @@
/* This script file handles the game logic */
+.import QtQuick.LocalStorage 2.0 as Sql
+
var maxColumn = 10;
var maxRow = 15;
var maxIndex = maxColumn * maxRow;
@@ -191,7 +193,7 @@ function saveHighScore(name) {
if (scoresURL != "")
sendHighScore(name);
- var db = openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores", 100);
+ var db = Sql.openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores", 100);
var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)";
var data = [name, gameCanvas.score, maxColumn + "x" + maxRow, Math.floor(gameDuration / 1000)];
db.transaction(function(tx) {
@@ -222,4 +224,3 @@ function sendHighScore(name) {
postman.send(postData);
}
//![1]
-