From 5d142cf2bf9a552ef069dee02af28a2507934550 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sun, 12 May 2019 21:58:03 +0200 Subject: Change directory name to be more informative --- js/vapi-background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 08a84bc..719cbdf 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -348,7 +348,7 @@ vAPI.storage = (function() { // Create path var path = Services.dirsvc.get('ProfD', Ci.nsIFile); - path.append('extension-data'); + path.append('ematrix-data'); if ( !path.exists() ) { path.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt('0774', 8)); } -- cgit v1.2.3 From 7859df9bc216bfd9f27a8841859da20f906dfb9d Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sun, 12 May 2019 22:06:31 +0200 Subject: Migrate database from old directory --- js/vapi-background.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 719cbdf..d2a9b66 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -347,7 +347,7 @@ vAPI.storage = (function() { } // Create path - var path = Services.dirsvc.get('ProfD', Ci.nsIFile); + let path = Services.dirsvc.get('ProfD', Ci.nsIFile); path.append('ematrix-data'); if ( !path.exists() ) { path.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt('0774', 8)); @@ -355,6 +355,13 @@ vAPI.storage = (function() { if ( !path.isDirectory() ) { throw Error('Should be a directory...'); } + + let path2 = Services.dirsvc.get('ProfD', Ci.ndIFile); + path2.append('extension-data'); + if (path2.exists()) { + path2.append(location.host + '.sqlite'); + path2.copyTo(path, location.host + '.sqlite'); + } path.append(location.host + '.sqlite'); // Open database @@ -488,6 +495,7 @@ vAPI.storage = (function() { } var prepareResult = function(result) { + console.debug(result); var key; for ( key in result ) { if ( result.hasOwnProperty(key) === false ) { -- cgit v1.2.3 From 8ef453fe1ac8d80f90216de188e4b98df70dab22 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Sun, 12 May 2019 22:09:46 +0200 Subject: Fix typo --- js/vapi-background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index d2a9b66..09a5842 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -356,7 +356,7 @@ vAPI.storage = (function() { throw Error('Should be a directory...'); } - let path2 = Services.dirsvc.get('ProfD', Ci.ndIFile); + let path2 = Services.dirsvc.get('ProfD', Ci.nsIFile); path2.append('extension-data'); if (path2.exists()) { path2.append(location.host + '.sqlite'); -- cgit v1.2.3 From 08e1b5aef425090e4dc91978968a97bc5b38e53d Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Mon, 13 May 2019 17:41:19 +0200 Subject: Fix handling of existing data --- js/vapi-background.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 09a5842..67d540e 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -359,8 +359,7 @@ vAPI.storage = (function() { let path2 = Services.dirsvc.get('ProfD', Ci.nsIFile); path2.append('extension-data'); if (path2.exists()) { - path2.append(location.host + '.sqlite'); - path2.copyTo(path, location.host + '.sqlite'); + path2.moveTo(null, path.leafName); } path.append(location.host + '.sqlite'); -- cgit v1.2.3 From ed723f785722d91d2a19703e71aa703367fbecac Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Mon, 13 May 2019 18:47:29 +0200 Subject: Remove a debugging statement --- js/vapi-background.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/vapi-background.js') diff --git a/js/vapi-background.js b/js/vapi-background.js index 67d540e..9088748 100644 --- a/js/vapi-background.js +++ b/js/vapi-background.js @@ -494,7 +494,6 @@ vAPI.storage = (function() { } var prepareResult = function(result) { - console.debug(result); var key; for ( key in result ) { if ( result.hasOwnProperty(key) === false ) { -- cgit v1.2.3