Make samegame work again
authorKent Hansen <kent.hansen@nokia.com>
Fri, 24 Aug 2012 11:31:52 +0000 (13:31 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 24 Aug 2012 12:20:52 +0000 (14:20 +0200)
Fixes regression caused by commit
6ebf215fdaf2d757ab90ae4d46c4b938e978e2dc. The commit did update the
autotests to use "Sql.LocalStorage.openDatabaseSync" instead of the
old "Sql.openDatabaseSync", but the examples and demos were not
updated accordingly.

Task-number: QTBUG-26928
Change-Id: Ifcff830e195a05a26ee095e11d4185f6d94eb1aa
Reviewed-by: Leonardo Sobral Cunha <leo.cunha@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
examples/demos/samegame/content/samegame.js
examples/tutorials/samegame/samegame4/content/samegame.js

index 456007c..d06221a 100755 (executable)
@@ -464,7 +464,7 @@ function puzzleVictoryCheck(clearedAll)//gameOver has also been set if no more m
 
 function getHighScore()
 {
-    var db = Sql.openDatabaseSync(
+    var db = Sql.LocalStorage.openDatabaseSync(
         "SameGame",
         "2.0",
         "SameGame Local Data",
@@ -487,7 +487,7 @@ function getHighScore()
 function saveHighScore(score)
 {
     // Offline storage
-    var db = Sql.openDatabaseSync(
+    var db = Sql.LocalStorage.openDatabaseSync(
         "SameGame",
         "2.0",
         "SameGame Local Data",
@@ -513,7 +513,7 @@ function saveHighScore(score)
 
 function getLevelHistory()
 {
-    var db = Sql.openDatabaseSync(
+    var db = Sql.LocalStorage.openDatabaseSync(
         "SameGame",
         "2.0",
         "SameGame Local Data",
@@ -536,7 +536,7 @@ function getLevelHistory()
 
 function saveLevelHistory()
 {
-    var db = Sql.openDatabaseSync(
+    var db = Sql.LocalStorage.openDatabaseSync(
         "SameGame",
         "2.0",
         "SameGame Local Data",
index 7bb7243..ad4d39d 100755 (executable)
@@ -193,7 +193,7 @@ function saveHighScore(name) {
     if (scoresURL != "")
         sendHighScore(name);
 
-    var db = Sql.openDatabaseSync("SameGameScores", "1.0", "Local SameGame High Scores", 100);
+    var db = Sql.LocalStorage.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) {