cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [4/6] git commit: Update file handling code to modern File plugin (post Ian's refactoring)
Date Mon, 27 Jan 2014 16:04:19 GMT
Update file handling code to modern File plugin (post Ian's refactoring)


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/7d624328
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/7d624328
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/7d624328

Branch: refs/heads/master
Commit: 7d6243284e9db5f449596fa4efada22bebf3611e
Parents: 6f99f08
Author: Braden Shepherdson <braden.shepherdson@gmail.com>
Authored: Thu Jan 23 15:11:38 2014 -0500
Committer: Braden Shepherdson <braden.shepherdson@gmail.com>
Committed: Thu Jan 23 15:11:38 2014 -0500

----------------------------------------------------------------------
 www/cdvah/js/ResourcesLoader.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/7d624328/www/cdvah/js/ResourcesLoader.js
----------------------------------------------------------------------
diff --git a/www/cdvah/js/ResourcesLoader.js b/www/cdvah/js/ResourcesLoader.js
index e6faecf..8d634f3 100644
--- a/www/cdvah/js/ResourcesLoader.js
+++ b/www/cdvah/js/ResourcesLoader.js
@@ -6,8 +6,12 @@
         var rootDir;
 
         function initialiseFileSystem() {
-            // HACK: Need to discuss better way to get the root entry.
-            return $q.when(rootDir = new $window.DirectoryEntry('/', '/'));
+            var d = $q.defer();
+            $window.resolveLocalFileSystemURL('file:///', function(entry) {
+                rootDir = entry;
+                d.resolve(entry);
+            }, d.reject);
+            return d.promise;
         }
 
         //promise returns full path to downloaded file


Mime
View raw message