27 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
28 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
29 Components.utils.import(
"resource://app/jsmodules/sbLocalDatabaseMigrationUtils.jsm");
30 Components.utils.import(
"resource://app/jsmodules/SBJobUtils.jsm");
32 const Cc = Components.classes;
33 const Ci = Components.interfaces;
34 const Cr = Components.results;
37 dump(
"----++++----++++sbLibraryMigration " +
40 "\n----++++----++++\n");
45 SBLocalDatabaseMigrationUtils.BaseMigrationHandler.call(
this);
47 this.fromVersion = 15;
49 this.versionString = this.fromVersion +
" to " +
58 __proto__: SBLocalDatabaseMigrationUtils.BaseMigrationHandler.prototype,
60 classID: Components.ID(
"{bcc617e0-1dd1-11b2-b34d-d3db6eea6e70}"),
61 contractID: SBLocalDatabaseMigrationUtils.baseHandlerContractID +
' 15 to 16',
63 _databaseLocation:
null,
66 migrate:
function sbLibraryMigration_migrate(aLibrary) {
69 this._databaseGUID = aLibrary.databaseGuid;
70 this._databaseLocation = aLibrary.databaseLocation;
72 var query = this._createQuery();
75 query.addQuery(
"update library_metadata set value = '"
76 + this.toVersion +
"' where name = 'version'");
77 query.addQuery(
"commit");
80 query.addQuery(
"VACUUM");
83 query.setAsyncQuery(
true);
84 query.execute(retval);
88 var
prefs =
Cc[
"@mozilla.org/preferences-service;1"]
89 .getService(
Ci.nsIPrefBranch);
90 prefs.setBoolPref(
"songbird.databaseengine." +
91 this._databaseGUID +
".invalidCollationIndex",
true);
92 prefs.QueryInterface(
Ci.nsIPrefService).savePrefFile(
null);
95 dump(
"Exception occured: " + e);
100 _createQuery:
function sbLibraryMigration_createQuery() {
101 var query =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
102 .createInstance(
Ci.sbIDatabaseQuery);
103 query.databaseLocation = this._databaseLocation;
104 query.setDatabaseGUID(this._databaseGUID);
115 return XPCOMUtils.generateModule([
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function sbLibraryMigration()
function NSGetModule(compMgr, fileSpec)
sbDeviceFirmwareAutoCheckForUpdate prototype classID