Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
infil00p committed Oct 23, 2012
2 parents f9ef38c + 6a1e089 commit e11bead
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 4 additions & 5 deletions framework/src/org/apache/cordova/CordovaWebView.java
Expand Up @@ -731,11 +731,10 @@ else if (strNode.equals("preference")) {
}

// Init preferences
if ("false".equals(this.getProperty("useBrowserHistory", "false"))) {
this.useBrowserHistory = false;
}
else {
this.useBrowserHistory = true;
this.useBrowserHistory = !"false".equals(this.getProperty("useBrowserHistory", "true"));
if (!this.useBrowserHistory) {
// Deprecated in Cordova 2.2.0.
Log.w(TAG, "useBrowserHistory=false is deprecated. Use history.back() instead of navigator.app.backHistory().");
}

if ("true".equals(this.getProperty("fullscreen", "false"))) {
Expand Down
15 changes: 14 additions & 1 deletion framework/src/org/apache/cordova/Storage.java
Expand Up @@ -137,7 +137,20 @@ public void openDatabase(String db, String version, String display_name,
this.path = this.cordova.getActivity().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
}

this.dbName = this.path + File.pathSeparator + db + ".db";
this.dbName = this.path + File.separator + db + ".db";

/*
* What is all this nonsense? Well the separator was incorrect so the db was showing up in the wrong
* directory. This bit of code fixes that issue and moves the db to the correct directory.
*/
File oldDbFile = new File(this.path + File.pathSeparator + db + ".db");
if (oldDbFile.exists()) {
File dbPath = new File(this.path);
File dbFile = new File(dbName);
dbPath.mkdirs();
oldDbFile.renameTo(dbFile);
}

this.myDb = SQLiteDatabase.openOrCreateDatabase(this.dbName, null);
}

Expand Down

0 comments on commit e11bead

Please sign in to comment.